Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having some trouble setting up a subdomain for I've set up a DNS A record to point to my IP address, and I've created proxy and vhost information for nginx and apache, but I'm getting a server not found response when I go to the address.

The Nginx config looks like this:

upstream backend {

server {
    listen 80;

    location / {
        proxy_pass http://backend;
        include /etc/nginx/proxy.conf;

And the Apache file reads:

<VirtualHost *:8080>

    <Directory /path/to/wsgi/parent/dir/>
        Order deny,allow
        Deny from all

    WSGIDaemonProcess user=www-data group=www-data threads=25

    WSGIScriptAlias / /path/to/wsgi/file/

I'm really at a loss as to why it's not working. Can anyone shed any light?

Thank you.

Edit: This problem seems to have resolved itself, though I'm none the wiser as to how. I changed the A record to a CNAME, which did nothing, so I changed it back. After rewriting the config files a few times, it finally worked, though I'm fairly sure I didn't do anything differently. I'd be interested to hear people's thoughts on this...

share|improve this question
What exact version of Apache are you using? – Tim Post Oct 7 '09 at 18:18
It's Apache2 (running on Ubuntu Server 9.04 if that makes any difference) – Gary Chambers Oct 7 '09 at 18:25
DNS name propagation can take a while if this had to be reflected into wider Internet in order to be able to use it. – Graham Dumpleton Oct 8 '09 at 5:09

Try this config:

location / {
    proxy_pass http://backend;
    proxy_set_header  Host       $host;
    include /etc/nginx/proxy.conf;

note addition of proxy_set_header Host $host that will forward host header to apache

You also may need to pass

proxy_set_header   X-Forwarded-For $remote_addr;

to apache and then proccess it to get user's IP address.

share|improve this answer

Your Answer


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.