Docker NGINX反向代理问题

时间:2020-03-27 18:20:42

标签: docker nginx

我正在尝试配置Docker Nginx,我碰到了我确定是愚蠢的问题,但无法弄清楚它是什么。

1)我配置了一个名为proxy.conf的.conf文件,并将其复制到/etc/nginx/conf.d /

/ # cat /etc/nginx/conf.d/proxy.conf server {
    listen       80;
    #server_name  rf-epmcloud.com;
    server_name  localhost;
    #charset koi8-r;
    #access_log  /var/log/nginx/host.access.log  main;
    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        #proxy_pass https://www.aol.com;
        proxy_pass http://192.168.1.111:9000/epmcloud;
    }
    #error_page  404              /404.html;
    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    } }

2)当我将proxy_pass设置为https://www.aol.com时,它可以工作;

3)无法使其与proxy_pass http://192.168.1.111:9000/epmcloud一起使用;

4)当我尝试从容器ping IP时,它工作正常...

/
PING 192.168.1.111 (192.168.1.111): 56 data bytes
64 bytes from 192.168.1.111: seq=0 ttl=37 time=2.310 ms
64 bytes from 192.168.1.111: seq=1 ttl=37 time=1.001 ms
64 bytes from 192.168.1.111: seq=2 ttl=37 time=1.003 ms
^Z[1]+  Stopped                    ping 192.168.1.111
/ #

5)附件是我从浏览器中获得的错误,即Safari无法打开localhost / epmcloud。本地主机应说192.168.1.111:9000。

prints screen of error message on Safari

0 个答案:

没有答案