Nginx configuration issues

0

I need nginx to serve a certain location for a certain directory request, for example:

localhost/this_site

to serve

/path/to/this_site

How can I make that work?

George K.

Posted 2012-12-25T16:38:00.157

Reputation: 243

so when someone goes to http://localhost/this_site you want to serve the contents of /path/to/this_site? – Wayne Werner – 2012-12-27T17:44:08.680

Exactly right!! – George K. – 2012-12-27T17:53:50.570

If my answer solved your problem you should mark it accepted by clicking the green checkmark – Wayne Werner – 2012-12-31T15:00:30.580

Answers

1

You want the location (This post about nginx, django, and gunicorn has a good introduction).

server {
    ... your server code here ...
    location /this_site/ {
        root /path/to/this_site;
    }
}

Should do what you're looking for.

Wayne Werner

Posted 2012-12-25T16:38:00.157

Reputation: 1 501