nginx.conf
我的 Mac 上有以下幾行:
location /addPat {
resolver 8.8.8.8;
proxy_pass http://some_url:8080$request_uri;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
這是直接從運行 Debian 的同一網路上的電腦複製的。沒有差別。
但是,雖然該指令在 Linux 機器上完美運行,但在我的 Mac 上卻不斷返回 404;日誌條目是這樣的:
2014/05/12 17:04:35 [error] 437#0: *13 "/usr/local/Cellar/nginx/1.4.6/html/addPat/index.html" is not found (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /addPat/ HTTP/1.1", host: "localhost"
這很煩人,因為當您期望它在所有平台上工作時,它看起來不一致。
這是怎麼回事?