[unix_http_server]
file=/tmp/supervisor.sock ; the path to the socket file
;chmod=0700 ; socket file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=test ; default is no username (open server)
;password=test ; default is no password (open server)
[inet_http_server] ; inet (TCP) server disabled by default
port=0.0.0.0:9001 ; ip_address:port specifier, *:port for all iface
username=test ; default is no username (open server)
password=test ; default is no password (open server)
upstream uwsgi_backend {
server 127.0.0.1:8002;
}
server {
listen 80;
server_name mydomain.com;
location ^~ /.git {
deny all;
}
location ^~ /static {
root /;
index index.html;
expires 1M;
access_log off;
add_header Cache-Control "public";
}
location / {
proxy_next_upstream error timeout http_500 http_503;
proxy_connect_timeout 4000ms;
proxy_read_timeout 30s;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Rewrite-URL $request_uri;
client_max_body_size 10m;
uwsgi_pass uwsgi_backend;
include uwsgi_params;
}
}
# 这里是出问题的地方,为希望能通过代理 9001 端口到本地的 0.0.0.0:9001 实现公网访问
server {
listen mydomain.com:9001;
server_name mydomain.com;
location / {
proxy_pass http://0.0.0.0:9001;
proxy_buffering off;
}
}
下面是我谷歌搜索了很多跟我这个情况不太一样,求大神指点。
https://segmentfault.com/a/1190000006902417
https://serverfault.com/questions/858859/nginx-proxy-pass-to-supervisord
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.