Custom Nginx Configuration
server
{
listen 80;
underscores_in_headers on;
location /employee
{
root /var/web;
index index.html index.htm;
try_files $uri $uri/ /employee/index.html;
}
}This
locationblock specifies the “/employee” prefix compared with the URI from the request. For matching requests, the URI will be added to the path specified in the root directive, that is, to/var/web, to form the path to the requested file on the local file systemUsing
try_filesmeans that you can test a sequence. If$uridoesn’t exist, try$uri/, if that doesn’t exist try a fallback location. In this case, if the$urifile exists, serve it. If not, check if that directory exists. If not, then proceed to/employee/index.htmlwhich you make sure exists.