2011-04-05 118 views

回答

4

您可以在Windows上安裝Node.js的,但它是它自己的服務器,所以除非你正在使用IIS作爲代理它,就沒有必要對IIS的。請注意,從Node.js's installation instructions引用以下內容:

兩個[Windows]版本都不令人滿意穩定,但可以運行某些東西。

+0

涼爽。是否有類似於iis的內容? – 2011-04-05 02:26:10

+0

不知道,但我對此表示懷疑。 – 2011-04-05 03:50:00

2

我一直在使用的Windows節點與Cygwin和有一些問題。您可以使用IIS在默認端口80上運行,並在不同端口上運行Node應用程序。

如果你想代理,那麼大多數都使用Nginx。

1

可以在Windows build node.js的,但不建議使用它由於可能的穩定性問題。如果IIS使用基於線程的池,那麼對於node.js,您甚至不應該將它用作reverse proxy(在基於Linux的系統上nginx通常用於執行此操作),因爲池可能會很快完全加載。如果你想在窗口上使用類似node.js的東西,那麼你應該嘗試看看manos

2

實際上需要運行通過IIS使Node.js應用兩條路線。

如果您正在致力於整個應用程序的Node.js和只需要面向公衆的端點通過現有的IIS應用程序的工作,我會建議使用ARR通過路由整個網站。我爲幾個項目做了這個,並且它工作得很好。

說實話,我並不喜歡IISNode,因爲它好像你在你的節點代碼與IIS使外國人端點。它有效,如果你特別針對Azure,它可能是你最好的選擇。如果您需要將它放入現有的.Net應用程序中,它也可能是最好的選擇。

0

我想讓它儘可能簡單。

與iisnode問題

  1. 我安裝iisnode跑沒有問題,我試着用iisnode部署在IIS上的樣品,但...

  2. ,但我不得不捆綁我的流星應用程序,然後將其作爲節點應用程序部署。我遇到的問題使我感到灰心。我不能讓fibers安裝在所有。編譯過程中不斷出現錯誤,所以我放棄了。

反向代理IIS

我做了什麼來解決這個對我來說是使用IIS上的反向代理。

see my post on meteor forum

我最後的web.config項是:

我也一樣,但是,我對IIS反向代理使用 方式對域名的子文件夾丟給我的。

我不知道,通過使用ROOT_URL我們可以指定一個子 路徑。

例如,如果我跑我的流星的應用程序文件夾中的以下命令:

set ROOT_URL=http://localhost:3100/n/todos && meteor

我將能夠http://localhost:3100/n/todos訪問我的應用程序, 通知我省略了結尾/。如果我們試圖瀏覽到 地址http://localhost:3100/nhttp://localhost:3100/將 給我們一個錯誤Unknown path

所以,當我第一次設置反向代理,我每次得到Unknown Path錯誤。

原來,在我的IIS的配置,我必須指定 http://localhost:3100/n/todos作爲操作的URL值,請 通知「N /待辦事項」結尾。

所以我重寫規則弄成這個樣子:[文件@ C:/inetpub/wwroot/web.config]

``` 
<configuration> 
    <system.webServer> 
    <rewrite> 
     <rules> 
     <rule name="TODOs meteor app. Route the requests" stopProcessing="true" enabled="true"> 
      <match url="^n/todos/(.*)" /> 
      <conditions> 
      <add input="{CACHE_URL}" pattern="^(https?)://" /> 
      </conditions> 
      <action type="Rewrite" url="{C:1}://localhost:3100/n/todos/{R:1}" /> <!-- I was missing the /n/todos here --> 
      <serverVariables> 
      <set name="HTTP_ACCEPT_ENCODING" value="" /> 
      </serverVariables> 
     </rule> 
     </rules> 
     <outboundRules> 
     <rule name="TODOs ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1" enabled="false"> 
      <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://localhost:3100/(.*)" /> 
      <action type="Rewrite" value="/n/todos/{R:2}" /> 
     </rule> 
     <rule name="TODOs RewriteRelativePaths" preCondition="ResponseIsHtml1" enabled="false"> 
      <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^/(.*)" negate="false" /> 
      <action type="Rewrite" value="/n/todos/{R:1}" /> 
     </rule> 
     <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1"> 
      <match filterByTags="A, Form, Img" pattern="^http(s)?://localhost:3100/(.*)" /> 
      <action type="Rewrite" value="http{R:1}://localhost/{R:2}" /> 
     </rule> 
     <preConditions> 
      <preCondition name="ResponseIsHtml1"> 
      <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /> 
      </preCondition> 
     </preConditions> 
     </outboundRules> 
    </rewrite> 
    </system.webServer> 
</configuration> 
``` 

感謝

相關問題