Outils pour utilisateurs

Outils du site


all:bibles:linux:serveur:reverse-proxy

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
all:bibles:linux:serveur:reverse-proxy [2024/06/14 11:10] – créée - modification externe 127.0.0.1all:bibles:linux:serveur:reverse-proxy [2024/07/18 11:08] (Version actuelle) – [Configuration] omeylhoc
Ligne 1: Ligne 1:
 +====== Reverse Proxy ======
 +
 +===== Installation sur Ubuntu Server 20.04 LTS =====
 +
 +==== Packages ====
 +
 +----
 +
 +<code bash>
 +sudo apt-get install apache2 certbot libapache2-mod-php
 +</code>
 +
 +==== Activation modules ====
 +
 +<code bash>
 +sudo a2enmod php7.4 proxy proxy_connect proxy_http proxy_wstunnel rewrite ssl
 +</code>
 +
 +==== Prise en compte ====
 +
 +<code bash>
 +sudo systemctl restart apache2
 +</code>
 +
 +==== Configuration ====
 +
 +<code apache>
 +<IfModule mod_ssl.c>
 +        <VirtualHost *:443>
 +                ServerName domaine1.fr
 +                ErrorLog ${APACHE_LOG_DIR}/domaine1.error.log
 +                CustomLog ${APACHE_LOG_DIR}/domaine1.log combined
 +
 +                ProxyPreserveHost On
 +                ProxyRequests Off
 +                ProxyVia Off
 +                ProxyPass / https://xxx.xxx.xxx.xxx:port1/
 +                ProxyPassReverse / https://xxx.xxx.xxx.xxx:port1/
 +
 +                SSLEngine on
 +                SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
 +                SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
 +                SSLProxyEngine On
 +                SSLProxyCheckPeerCN Off
 +                SSLProxyCheckPeerName Off
 +                SSLProxyCheckPeerExpire off
 +                SSLProxyVerify none
 +        </VirtualHost>
 +        <VirtualHost *:443>
 +                ServerName domaine2.fr
 +                ErrorLog ${APACHE_LOG_DIR}/domaine2.error.log
 +                CustomLog ${APACHE_LOG_DIR}/domaine2.access.log combined
 +
 +                ProxyPreserveHost On
 +                ProxyRequests Off
 +                ProxyVia Off
 +                ProxyPass / https://xxx.xxx.xxx.xxx:port2/
 +                ProxyPassReverse / https://xxx.xxx.xxx.xxx:port2/
 +
 +                RewriteEngine On
 +                RewriteCond %{HTTP:Upgrade} =websocket [NC]
 +                RewriteRule ^/(.*)    wss://xxx.xxx.xxx.xxx:port2/$1 [P,L]
 +
 +                SSLEngine on
 +                SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
 +                SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
 +                SSLProxyEngine On
 +                SSLProxyCheckPeerCN Off
 +                SSLProxyCheckPeerName Off
 +                SSLProxyCheckPeerExpire off
 +                SSLProxyVerify none
 +        </VirtualHost>
 +</code>
 +----
 +
 +[[all:bibles:linux:serveur:reverse-proxy|Haut de page]]