Adding a header with Haproxy
fr:Ajouter une en-tête avec Haproxy
This article has been created by an automatic translation software. You can view the article source here.
Introduction
We will see how to add an HTTP header with Haproxy.
Course
This can be done in the frontend, listen, or backend section of your Haproxy configuration.
In our example Haproxy is used for SSL offloading, it communicates with our backend (a Nginx server for example) in HTTP.
The application behind it is configured to force HTTPS, in order not to create a redirection loop we will have to send it a header to inform it that the initial protocol is HTTPS.
To do this, we will use Haproxy in our frontend configured in HTTPS, add a header X-Forwarded-Proto declared in https like this:
http-request add-header X-Forwarded-Proto https
Cet article vous a semblé utile ?
Enable comment auto-refresher