如何配置nginx使其与Express兼容?
我正在尝试配置nginx,以便它proxy_pass向我的节点应用程序发出请求。关于StackOverflow的问题有很多支持:https ://stackoverflow.com/questions/5009324/node-js-nginx-and-now ,我从那里开始使用config。 (但是由于问题是关于服务器配置的,因此应该在ServerFault上) 这是nginx的配置: 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': …