2
我有一个非常特殊的nginx的配置问题:nginx的配置,WebSocket的代理,位置,如果
我需要给nginx的:
- 代理WebSocket连接@/
- 将以index.html为响应标准的http请求@/
这是最接近我可以得到:
location =/{
if ($http_upgrade != "websocket") {
# Here lies my problem:
# This returns a http: 302 where i just need it to return the contents
# of index.html
return https://admin.permaconn.com/index.html;
}
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://localhost:8080;
}
我正在对我的应用程序进行结构更改,使用nodejs作为前端代理,将nginx作为前端代理。
我必须以这种方式配置nginx,因为许多程序已经安装了设备(aka legacy)的预期行为。
你是个好人,谢谢你。 – 2013-03-06 22:55:10