<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap:break-word"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Hello!</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">I copied your configuration, it seems a internal redirection cycled, you need to modify it(e.g. change the location / to location /=). After i modified, i didn’t reproduce your problem, the root directive works well.</div> <br> <div id="bloop_sign_1498575327163432960" class="bloop_sign"></div> <br><p class="airmail_on">On 27 June 2017 at 22:36:45, AjaySawant (<a href="mailto:nginx-forum@forum.nginx.org">nginx-forum@forum.nginx.org</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>I have one AngularJS application deployed on port 8080. It can be access as
<br><a href="http://ip:8080">http://ip:8080</a>. Now I have deployed the application on nginx and I am trying
<br>to access this application via nginx reverse proxy configuration but I am
<br>getting 404 error in nginx log as it looks like the nginx is searching the
<br>application in wrong directory. My application is in /usr/share/nginx/html
<br>directory but the reverse proxy is looking the app in /etc/nginx/html. Here
<br>is my configuration and I am using Ubuntu 16.04
<br>
<br>server {
<br>        listen       80 default_server;
<br>        server_name  _;
<br>        location /app/ {
<br>                proxy_redirect off;
<br>                proxy_set_header X-Forwarded-Host $host;
<br>                proxy_set_header X-Forwarded-Server $host;
<br>                proxy_set_header X-Forwarded-For
<br>$proxy_add_x_forwarded_for;
<br>                proxy_pass <a href="http://localhost:8080/">http://localhost:8080/</a>;
<br>        }
<br>}
<br>
<br>server {
<br>   listen 8080;
<br>   root /usr/share/nginx/html;
<br>   index index.html index.htm;
<br>   server_name _;
<br>   location / {
<br>       try_files $uri $uri/ /index.html;
<br>
<br>   }
<br>   error_page  404     /404.html;
<br>   error_page  403     /403.html;
<br>   error_page  405     =200 $uri;
<br>}
<br>
<br>Can somebody tell me what am I doing wrong?
<br>
<br>Posted at Nginx Forum: <a href="https://forum.nginx.org/read.php?2,275154,275154#msg-275154">https://forum.nginx.org/read.php?2,275154,275154#msg-275154</a>
<br>
<br>_______________________________________________
<br>nginx mailing list
<br><a href="mailto:nginx@nginx.org">nginx@nginx.org</a>
<br><a href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a>
<br></div></div></span></blockquote></body></html>