samedi 28 septembre 2019

Nginx location not working even as expected

The following is the configuration I have in my project nginx.conf. When I am trying to access the application by using the url http://localhost:8080/session/ , I am getting the error 404 not found.

The url works fine if I have the location as

location / { }

server {
listen       80;
server_name  localhost;
error_page   500 502 503 504  /50x.html;
location = /50x.html {
    root   /usr/share/nginx/html;
}
location /session {
    root   /app;
    index  index.html;
    try_files $uri $uri/ /index.html;
}

}




Aucun commentaire:

Enregistrer un commentaire