Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We are using nginx to serve static content and apache for dynamic content.

I have defined a default server configuration as:

#Set a default server that simply proxies all requests to apache
server 
{
    listen 80 default_server;
    server_name _;

    location / 
    {
        proxy_pass http://127.0.0.1:8080;
    }
}

Is the the best way to proxy everything to apache if for some reason a server_name does not match?

share|improve this question
    
I do not get your question, this is a copy-paste from the nginx wiki. Are you asking whether the nginx wiki is correct? Erm, yes, it is... –  chx Sep 27 '12 at 18:04
    
What I am asking is, if I want to proxy all requests to apache, is this the best way? –  Chris Muench Sep 27 '12 at 18:13
add comment

1 Answer

up vote 3 down vote accepted

Yes this is the best and the only sensible way. You could even omit the servername completely.

share|improve this answer
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.