I think this is a bug in Django. I am not using Nginx or Gunicorn and am
also experiencing the same issue.
http://sandbox.junior.evandro.dev.tecknoquest.com/
On that page the "Customer Service Django App
<http://sandbox.junior.evandro.dev.tecknoquest.com/cs>" link works with
and without a slash at the end.
http://ballin.mikedoroshenko.com/
Backup copy of the site above (when I just purchased that domain and was
playing around with DNS hence the ballin name lol). On that site
clicking the same link on this site opens the user's browser to
localhost instead of proxying. I get redirected to localhost without
even seeing any output come up in terminal window for the dev server.
Adding a slash makes it work fine.
Daniel Oz'minkowski wrote:
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
--
Mike Doroshenko, Junior Sys Admin
TecKnoQuest Inc.
mi...@tecknoquest.com
www.tecknoquest.com
--
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.