从主机到docker容器的nginx反向代理在某些端口上不起作用

时间:2015-03-31 19:14:36

标签: curl nginx proxy docker

在我的nginx.conf中我有

服务器 {     gzip_types text / plain text / css application / json application / x-javascript text / xml application / xml application / xml + rss text / javascript;

listen       80;
server_name  localhost;
proxy_buffering off;


location /blog/ {

    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_pass http://172.17.0.94:9001/;
include /etc/nginx/proxy_params;
}

location /admin/ {

    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_pass http://172.17.0.94:9000/;
include /etc/nginx/proxy_params;
}


location /api/ {

    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_pass http://172.17.0.94:1337/;
include /etc/nginx/proxy_params;
}

}

反向代理正常工作并加载管理内容,但不能加载/ api或/ blog内容,即使我可以使用其IP和端口卷入其中。任何更熟悉nginx的人都可能知道这里有什么问题吗?

0 个答案:

没有答案