nginx How to add a simple path to folder

October 31, 2014 2k views

I wish to add a simple folder off the root of my domain called resume.
my root looks like this

location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header HOST $http_host;
        proxy_set_header X-NginX-Proxy true;
        root /opt/cornerpinsRoot;
        index index.html index.htm;
    }

it works fine, but adding this

location /resume/ {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header HOST $http_host;
        proxy_set_header X-NginX-Proxy true;
        root /opt/resume;
        index index.html index.htm PaulStocks.html;
    }

I get 404 not found errors from nginx.

The folders all have the correct/same permissions and nginx -t and -s reload say I'm fine. Both cornerpins.com/resume/index.html and cornerpins.com/resume fail.

What am I missing to get [http://cornerpins.com/resume](http://) to work?

1 Answer

figured it out ..... leave off the folder
root /opt

Have another answer? Share your knowledge.