nanaya
July 29, 2022 04:16PM
I have a few questions about the real ip module (tried on nginx/1.22.0):

1. is there no way to reset the list of `set_real_ip_from` for a specific subsection? For example to have a completely different set of trusted addresses for a specific server

2. does setting `real_ip_header '';` in a section effectively disable the module for the section?

3. documentation says `real_ip_header` is allowed in location block but it doesn't seem to do anything?

This still uses address from X-Real-Ip instead of X-Other for allow check and log:

http {
real_ip_header X-Real-Ip;
...
server {
location /data/ {
real_ip_header X-Other;
allow 10.0.0.1; # <- checks against value from X-Real-Ip
deny all;
access_log /var/log/nginx/data.log; # <- logs address from X-Real-Ip
}
}
}

Similarly I tried this version as well and it behaves the same:

location /da {
real_ip_header X-Other;
location /data/ {
allow 10.0.0.1;
deny all;
access_log /var/log/nginx/data.log;
}
}
_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
Subject Author Posted

Questions about real ip module

nanaya July 29, 2022 04:16PM

Re: Questions about real ip module

Francis Daly August 02, 2022 06:36PM

Re: Questions about real ip module

nanaya August 03, 2022 02:02AM

Re: Questions about real ip module

Francis Daly August 03, 2022 06:54PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 286
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready