real ip pour Nginx

This commit is contained in:
Jérémy Lecour 2020-11-03 13:57:48 +01:00 committed by Jérémy Lecour
parent a01e2052ce
commit 7747b84f1a
2 changed files with 7 additions and 0 deletions

View file

@ -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;
}

View file

@ -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;
}