Добрый день.
Подскажите где ошибся при настройке nginx
конфиг nginx:
server {
if ($host = graf.rmiac18.ru) {
return 301 https://$host$request_uri;
}
listen 80;
server_name graf.rmiac18.ru;
access_log /var/log/nginx/grafana-access.log;
error_log /var/log/nginx/grafana-error.log;
set_real_ip_from 78.85.54.198;
real_ip_header X-Real-IP;
return 301 https://$server_name$request_uri;
}
server {
listen 8443 ssl http2;
server_name graf.rmiac18.ru;
access_log /var/log/nginx/grafana-ssl-access.log;
error_log /var/log/nginx/grafana-ssl-error.log;
set_real_ip_from 78.85.54.198;
real_ip_header X-Real-IP;
ssl on;
ssl_certificate /etc/letsencrypt/live/graf.rmiac18.ru/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/graf.rmiac18.ru/privkey.pem; # managed by Certbot
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
location /.well-known/acme-challenge/ {
root /var/www/html/;
}
location / {
proxy_pass http://192.168.139.56:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
}
}
в логах:
127.0.0.1 - - [07/May/2024:00:00:30 +0400] "GET /api/live/ws HTTP/1.1" 400 12 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
127.0.0.1 - - [07/May/2024:00:00:32 +0400] "GET /api/live/ws HTTP/1.1" 400 12 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
127.0.0.1 - - [07/May/2024:00:00:40 +0400] "GET /api/live/ws HTTP/1.1" 400 12 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.5993.784 YaBrowser/23.11.1.784 (corp) Yowser/2.5 Safari/537.36"
127.0.0.1 - - [07/May/2024:00:00:40 +0400] "GET /api/live/ws HTTP/1.1" 400 12 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
127.0.0.1 - - [07/May/2024:00:00:44 +0400] "GET /api/live/ws HTTP/1.1" 400 12 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.5993.784 YaBrowser/23.11.1.784 (corp) Yowser/2.5 Safari/537.36"
как в логах видеть реальный ip пользователей?