I've got a webapp constructed with Django. I am presently running them back a laptop in your own home behind a router.
I've the router set up to route all traffic delivered to a particular port to that particular laptop.
I've Nginx like a reverse proxy for Apache, using mod_wsgi to operate Django.
My issue is this: after i attempt to submit any Publish form, the main harbour # will get taken off the url (e.g. 220.127.116.11:1552/login/ becomes 18.104.22.168/login/)
Naturally, this breaks. What can cause this (Nginx, Apache, Django?) and just how can one repair it?
Thanks ahead of time.
EDIT: It seems the forms DO submit, however i think the redirect fails.
EDIT 2: The issue is certainly either with Nginx, or even the interaction between Nginx and Apache. I attempted the setup with Apache because the only server, running django, also it labored fine. So either Nginx is shedding the main harbour, or in some way Apache gets confused by Nginx serving as the proxy.whatever
Given everything you are worried about is obvious HTTP (unlike something similar to AJP for example) I'd operate a protocol analyser for example Wireshark around the host and see after which the redirect is introduced.
I have a similar trouble with my development server. After a little search on the internet I have found this discussion (nginx, apache, and odd admin error) in which the option would be to change the proxy configuration of nginx.
The configuration setting to change is:
proxy_set_header Host $host
the answer would be to add the main harbour number:
proxy_set_header Host $host:$server_port
During my ngnix + apache2 (with worker mpm) + django now all is effective.
Look into the error logs. On Linux mine are in /var/log/apache2. Just managing a look for error.log should transform it up.