Accueil / Blog / Métier / Archives / Deploy Django behind a reverse proxy

Deploy Django behind a reverse proxy

Par Mathieu Leplatre publié 19/04/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'
ABONNEZ-VOUS À LA NEWSLETTER !
Voir aussi
Formation Django initiation à Toulouse du 13 au 15 mars Formation Django initiation à Toulouse du 13 au 15 mars 26/01/2017

Entrez de plain-pied dans l'univers de Django aux côtés de développeurs ayant une expérience de ...

Retour sur la PyConFr 2016 Retour sur la PyConFr 2016 18/10/2016

Nous étions présents à Rennes pour PyConFr 2016. Voici notre compte-rendu à chaud.

Wagtail: How to use the Page model and its manager (part 2) Wagtail: How to use the Page model and its manager (part 2) 08/08/2016

The Page model has several methods specific to Wagtail. This is also the case of its manager. We ...

Wagtail : How to make your own content type models (part 1) Wagtail : How to make your own content type models (part 1) 29/07/2016

We are used to initialize our CMS directly from a web interface, often including lots of complex ...

Presentation of the latest Django CMS: Wagtail Presentation of the latest Django CMS: Wagtail 22/07/2016

Wagtail is a quite recent Django CMS. However, its young age does not keep it from having a lot of ...