Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Unable to make my configuration work

$
0
0
My configuration looks like this...

server {
listen 80;
server_name 127.0.0.1 localhost;
location = /index.html {
root /etc/nginx/html/app1;
index index.html;
}

location / {
root /etc/nginx/html/app1;
index index.html;
}

location ^~ /common/ {
root /etc/nginx/html/common;
}
}

As you can see, I am trying to have different roots for different locations. Common folder is where I want to keep some common files. Unfortunately, with this configuration, I keep getting 404 for common. Index folder works as expected. If I copy the common folder inside app, it works as expected.

I wouldn't like to keep the common folder inside of app1 though. I am struggling big time with this configuration. Please help.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>