Hello,

first I want to state, that I am a beginner and everything still works a 
little like magic for me. I have always worked with django by running it 
with runserver. Recently decided to put it on virtual machine and serve the 
site with nginx + gunicorn. I understand how to serve static files and so 
on. Even my app works. I hit the problem when I try to access built-in 
admin interface. Everytime when I go to http://VMip/admin I get redirected 
to http://127.0.0.1:8000/.

I made sure that SITE_ID is the same in settings.py and the django_site 
table.

The server is on a VM, I access it by ip. Here is my nginx config in 
sites-enabled/my_app.

server {
    server_name 192.168.0.112; # I noticed it doesn't matter. Nginx serves 
the site even if VM ip changes... hmmm?
    listen 80;

    root /home/daniel/www
    index index.html index.htm
    client_max_body_size 32M;
    client_body_buffer_size 128k;
    location /static/ {
        root /home/daniel/www
    }

    location / {
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_connect_timeout 10;
        proxy_read_timeout 10;
        proxy_pass http://localhost:8000/;
    }
}

I will be very grateful for any clues how to fix it. Thanks!

Best regards,
Daniel

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to