Nginx 404 while accessing app

AjaySawant nginx-forum at forum.nginx.org
Tue Jun 27 16:37:56 UTC 2017


Thanks Toker for replying. I implemented your suggestion as given below but
it is not working. I am getting same error as earlier. I am not able to
understand why nginx is taking the docroot as /etc/nginx/html instead of
/usr/share/nginx/html.

server {
        listen       80 default_server;
        server_name  _;
        location /app/ {
                proxy_redirect off;
                proxy_set_header X-Forwarded-Host $host;
                proxy_set_header X-Forwarded-Server $host;
                proxy_set_header X-Forwarded-For
$proxy_add_x_forwarded_for;
                proxy_pass http://localhost:8080/;
        }
}

server {
   listen 8080;
   root /usr/share/nginx/html;
   index index.html index.htm;
   server_name _;
   location /= {
       try_files $uri $uri/ /index.html;

   }
   error_page  404     /404.html;
   error_page  403     /403.html;
   error_page  405     =200 $uri;
}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,275154,275169#msg-275169



More information about the nginx mailing list