Adding a header with Haproxy

From EN Ikoula wiki
Revision as of 09:48, 8 July 2021 by Ikbot (talk | contribs) (Created page with "<span data-link_translate_fr_title="Ajouter une en-tête avec Haproxy" data-link_translate_fr_url="Ajouter une en-tête avec Haproxy"></span>:fr:Ajouter une en-tête avec H...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽

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 ?

0



You are not allowed to post comments.