vendredi 8 avril 2016

Nginx Proxy_pass, leads to failed to load resource

I set up a web server on a machine (ip: 192.168.0.100:9000). My web page works fine if I directly visit it. But now, I want to visit it through another machine (ip: 192.168.0.200:9001). I set up a nginx proxy server on 192.168.0.200. When I visit http://ift.tt/1VdArJT, the web page shows all the js or css files can not be found. as

Failed to load resource: net::ERR_CONNECTION_REFUSED
http://ift.tt/1RVqgEa
Failed to load resource: the server responded with a status of 404 (Not Found)
http://ift.tt/1VdArJV 
Failed to load resource: the server responded with a status of 404 (Not Found)
.....

How can I set up it, that allows users visit the web page through the proxy server? Is that possible to set it up in nginx? My nginx config file on the 192.168.0.200 is:

server {
    listen 9001;

    location / {
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_set_header X-NginX-Proxy true;
      proxy_pass http://ift.tt/1RVqgEe;
      proxy_redirect http://ift.tt/1RVqgEe /;
    }

}




Aucun commentaire:

Enregistrer un commentaire