Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
so when someone goes to http://localhost/this_site you want to serve the contents of /path/to/this_site? –  Wayne Werner Dec 27 '12 at 17:44
    
Exactly right!! –  George K. Dec 27 '12 at 17:53
    
If my answer solved your problem you should mark it accepted by clicking the green checkmark –  Wayne Werner Dec 31 '12 at 15:00
add comment

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
Yep! Thanks a lot –  George K. Dec 31 '12 at 15:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.