I am having hard time finding a solution. I have a Ubuntu 14.04 machine running NGINX. I have below 2 folders I would like to host.
/var/www/apphost.comp.ill.com/app1/home/index.html /var/www/apphost.comp.ill.com/app2/index.html
I would like to open app1's index file when I go to "apphost.comp.ill.com/app1" and open app2's index file when I go to "apphost.comp.ill.com/app2".
I believe I need to edit "/etc/nginx/sites-available/apphost.comp.ill.com" to make it happen but I can't seem to figure out how. I tried multiple things, searched online but could not find any solution. Here is how my file looks like currently:
server {
listen 80;
listen [::]:80;
root /var/www/apphost.comp.ill.com/app1/home;
index index.html index.htm home home.html;
# Make site accessible from http://localhost/
server_name apphost.comp.ill.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
It works for app1 when I go to apphost.comp.ill.com. How can I make it so it works when I go to "apphost.comp.ill.com/app1" and also add app2 to work when I go to "apphost.comp.ill.com/app2".
Please help. Thanks