From 7747b84f1a79f90c47f31df7b442741116fe0c28 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Tue, 3 Nov 2020 13:57:48 +0100 Subject: [PATCH] real ip pour Nginx --- vhost-81.conf | 4 ++++ vhost-82.conf | 3 +++ 2 files changed, 7 insertions(+) diff --git a/vhost-81.conf b/vhost-81.conf index ff885ed..7bd7446 100644 --- a/vhost-81.conf +++ b/vhost-81.conf @@ -4,9 +4,13 @@ server { root /var/www/81; index index.html; # include /etc/nginx/snippets/letsencrypt.conf; + ssh_certificate ; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } + set_real_ip_from 127.0.0.1; + real_ip_recursive on; + real_ip_header X-Forwarded-For; } diff --git a/vhost-82.conf b/vhost-82.conf index 6db7451..c0b0c7e 100644 --- a/vhost-82.conf +++ b/vhost-82.conf @@ -9,4 +9,7 @@ server { # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } + set_real_ip_from 127.0.0.1; + real_ip_recursive on; + real_ip_header X-Forwarded-For; }