« Configuration Nginx : Reverse Proxy https » : différence entre les versions

De www.yakakliker.org
(Page créée avec « === Configuration Nginx === * Editer le fichier '''/etc/nginx/nginx.conf''' <syntaxhighlight lang="bash"> sudo nano /etc/nginx/nginx.conf </syntaxhighlight> * Ajouter cette ligne <syntaxhighlight lang="bash" line="1"> include /etc/nginx/passthrough.conf; </syntaxhighlight> * Créer le fichier '''/etc/nginx/passthrough.conf''' <syntaxhighlight lang="bash"> sudo nano /etc/nginx/passthrough.conf </syntaxhighlight> ==== Exemple de configuration ==== <syntaxhighl... »)
 
Aucun résumé des modifications
Ligne 58 : Ligne 58 :
[[Catégorie:Reverse Proxy]]
[[Catégorie:Reverse Proxy]]
[[Catégorie:Linux]]
[[Catégorie:Linux]]
‎<html>
<script src='https://storage.ko-fi.com/cdn/scripts/overlay-widget.js'></script>
<script>
  kofiWidgetOverlay.draw('yakakliker', {
    'type': 'floating-chat',
    'floating-chat.donateButton.text': 'Donate',
    'floating-chat.donateButton.background-color': '#00b9fe',
    'floating-chat.donateButton.text-color': '#fff'
  });
</script>
‎</html>

Version du 20 janvier 2025 à 14:24

Configuration Nginx

  • Editer le fichier /etc/nginx/nginx.conf
sudo nano /etc/nginx/nginx.conf
  • Ajouter cette ligne
include /etc/nginx/passthrough.conf;
  • Créer le fichier /etc/nginx/passthrough.conf
sudo nano /etc/nginx/passthrough.conf

Exemple de configuration

## tcp LB  and SSL passthrough for backend ##
stream {
    upstream site.exemple.org {
        server ADRESSE_IP:443 max_fails=3 fail_timeout=10s;
    }

log_format basic '$remote_addr [$time_local] '
                 '$protocol $status $bytes_sent $bytes_received '
                 '$session_time "$upstream_addr" '
                 '"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"';

    access_log /var/log/nginx/site.exemple.org_access.log basic;
    error_log  /var/log/nginx/site.exemple.org_error.log;

    server {
        listen 443;
        proxy_pass site.exemple.org;
        proxy_next_upstream on;
    }
}

Vérification de la configuration Nginx

sudo nginx -t

Rechargement de la configuration Nginx

sudo systemctl reload nginx

Liens

https://www.cyberciti.biz/faq/configure-nginx-ssltls-passthru-with-tcp-load-balancing/