Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site.domain returns 127.0.0.1 behind Nginx #19

Merged
merged 3 commits into from Apr 25, 2014
Merged

Site.domain returns 127.0.0.1 behind Nginx #19

merged 3 commits into from Apr 25, 2014

Conversation

dereknutile
Copy link
Contributor

Fixed an issue where site.domain returned 127.0.0.1:port# rather than the base URL in the email subject and template. This is an issue when running uwsgi/Gunicorn behind a proxy server like Nginx. Now we allow site.domain to be obtained from the database value first (if it exists) then from the url if it doesn't.

… URL in the email subject and template. This is an issue when running uwsgi/Gunicorn behind a proxy server like Nginx. Now we allow `site.domain` to be obtained from the database value first (if it exists) then from the url if it doesn't.
@brutasse
Copy link
Owner

Thanks for this! It looks like a proxy misconfiguration, though. I use nginx and never ran into this issue.

Do you have this in your nginx config?

proxy_set_header Host $http_host;

Looks like you touched something in success_url_name that doesn't seem related to that issue. Was that intentional?

If you could add a mention about the get_site() method in the docs it'd be great. Then I'll merge this :)

@dereknutile
Copy link
Contributor Author

Bruno,

Good call on the nginx missing configuration setting. However, I think there may be a reason proxy_set_header wasn't set on my live server and I'm scared to change it now! ;-) Regardless, I feel there is a valid reason to check the Django sites framework for the current value.

Regarding success_url_name: I did somehow overwrite this commit: 79ffe35, it wasn't intentional. I'll fix it and add something about get_site() in the docs.

@dereknutile
Copy link
Contributor Author

Let me know if I missed anything Bruno. -Derek

@brutasse
Copy link
Owner

@dereknutile thank you 👍

brutasse added a commit that referenced this pull request Apr 25, 2014
Site.domain returns 127.0.0.1 behind Nginx
@brutasse brutasse merged commit 04f2b3d into brutasse:master Apr 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants