如何configurationnginx,使其与Express一起工作?
我正在尝试configurationnginx,以便对我的节点应用程序进行proxy_pass请求。 StackOverflow的问题得到了许多upvotes: https ://stackoverflow.com/questions/5009324/node-js-nginx-and-now,我使用从那里的configuration。 (但由于问题是关于服务器configuration,它应该是在ServerFault上) 这里是nginxconfiguration: server { listen 80; listen [::]:80; root /var/www/services.stefanow.net/public_html; index index.html index.htm; server_name services.stefanow.net; location / { try_files $uri $uri/ =404; } location /test-express { proxy_pass http://127.0.0.1:3002; } location /test-http { proxy_pass http://127.0.0.1:3003; } } 使用普通节点: var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(3003, […]