11

Deploy Django behind a reverse proxy

 3 years ago
source link: https://blog.mathieu-leplatre.info/deploy-django-behind-a-reverse-proxy.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Deploy Django behind a reverse proxy

Deploy Django behind a reverse proxy

Tue 19 April 2011

By default, Django will assume that your root URL is the root (/) of your domain.

Using a reverse proxy, we can run multiple django instances on the same server, using the same domain. (http://server.org/site1/, http://server.org/site2/, ...)

Many redirects of your application will then be broken (most notable is validation of login form). You can fix that by forcing the root URL in your settings

FORCE_SCRIPT_NAME = '/site1'

If you use Sentry, you'll also have to set

SENTRY_URL_PREFIX = '/site1'

#tips, #deployment, #django - Posted in the Dev category


© Copyright 2020 by Mathieu Leplatre. mnmlist Theme

Content licensed under the Creative Commons attribution-noncommercial-sharealike License.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK