admin管理员组文章数量:1026389
I am having a backend webserver which works based on Nginx is being hidden behind a Reverse Proxy. I have managed to get the IP and Country of the Client but the issue is with the ISP. I need to know the ISP of the client for some security reasons, but I can see only the Reverse Proxy ISP. I believe that the issue is with the Backend Webserver Nginx. Can anyone have a look and advise?
The Setup is as following:
It would be great if you give advises for Caddy or Nginx Proxy Manager as I am more used to them. However, any answer and help is welcomed and appreciated.
Client <---> Domain <---> Cloudflare <---> Reverse Proxy <---> Backend Server
Note: Cloudflare is optional. I can remove it if needed.
Here is the backend Nginx configuration regarding the ISP part:
#ISP CONFIGURATION
server {
listen 8805;
root /home/directory1/directory2/isp/;
location / {
allow 127.0.0.1;
deny all;
}
location ~ \.php$ {
limit_req zone=one burst=8;
try_files $uri =404;
fastcgi_index index.php;
fastcgi_pass php;
include fastcgi_params;
fastcgi_buffering on;
fastcgi_buffers 96 32k;
fastcgi_buffer_size 32k;
fastcgi_max_temp_file_size 0;
fastcgi_keep_conn on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
}
I have tried several Reverse Proxies but all gives me the same results. I think that there should be a way to do it as I have seen similar webservers as me with the same configuration which works fine.
I am having a backend webserver which works based on Nginx is being hidden behind a Reverse Proxy. I have managed to get the IP and Country of the Client but the issue is with the ISP. I need to know the ISP of the client for some security reasons, but I can see only the Reverse Proxy ISP. I believe that the issue is with the Backend Webserver Nginx. Can anyone have a look and advise?
The Setup is as following:
It would be great if you give advises for Caddy or Nginx Proxy Manager as I am more used to them. However, any answer and help is welcomed and appreciated.
Client <---> Domain <---> Cloudflare <---> Reverse Proxy <---> Backend Server
Note: Cloudflare is optional. I can remove it if needed.
Here is the backend Nginx configuration regarding the ISP part:
#ISP CONFIGURATION
server {
listen 8805;
root /home/directory1/directory2/isp/;
location / {
allow 127.0.0.1;
deny all;
}
location ~ \.php$ {
limit_req zone=one burst=8;
try_files $uri =404;
fastcgi_index index.php;
fastcgi_pass php;
include fastcgi_params;
fastcgi_buffering on;
fastcgi_buffers 96 32k;
fastcgi_buffer_size 32k;
fastcgi_max_temp_file_size 0;
fastcgi_keep_conn on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
}
I have tried several Reverse Proxies but all gives me the same results. I think that there should be a way to do it as I have seen similar webservers as me with the same configuration which works fine.
Share Improve this question asked Nov 17, 2024 at 3:19 AniAni 11 Answer
Reset to default 0I think you can add proxy_set_header in location like this:
location / {
allow 127.0.0.1;
deny all;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
then nginx can pass client's host, client's real ip to bacnend server
I am having a backend webserver which works based on Nginx is being hidden behind a Reverse Proxy. I have managed to get the IP and Country of the Client but the issue is with the ISP. I need to know the ISP of the client for some security reasons, but I can see only the Reverse Proxy ISP. I believe that the issue is with the Backend Webserver Nginx. Can anyone have a look and advise?
The Setup is as following:
It would be great if you give advises for Caddy or Nginx Proxy Manager as I am more used to them. However, any answer and help is welcomed and appreciated.
Client <---> Domain <---> Cloudflare <---> Reverse Proxy <---> Backend Server
Note: Cloudflare is optional. I can remove it if needed.
Here is the backend Nginx configuration regarding the ISP part:
#ISP CONFIGURATION
server {
listen 8805;
root /home/directory1/directory2/isp/;
location / {
allow 127.0.0.1;
deny all;
}
location ~ \.php$ {
limit_req zone=one burst=8;
try_files $uri =404;
fastcgi_index index.php;
fastcgi_pass php;
include fastcgi_params;
fastcgi_buffering on;
fastcgi_buffers 96 32k;
fastcgi_buffer_size 32k;
fastcgi_max_temp_file_size 0;
fastcgi_keep_conn on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
}
I have tried several Reverse Proxies but all gives me the same results. I think that there should be a way to do it as I have seen similar webservers as me with the same configuration which works fine.
I am having a backend webserver which works based on Nginx is being hidden behind a Reverse Proxy. I have managed to get the IP and Country of the Client but the issue is with the ISP. I need to know the ISP of the client for some security reasons, but I can see only the Reverse Proxy ISP. I believe that the issue is with the Backend Webserver Nginx. Can anyone have a look and advise?
The Setup is as following:
It would be great if you give advises for Caddy or Nginx Proxy Manager as I am more used to them. However, any answer and help is welcomed and appreciated.
Client <---> Domain <---> Cloudflare <---> Reverse Proxy <---> Backend Server
Note: Cloudflare is optional. I can remove it if needed.
Here is the backend Nginx configuration regarding the ISP part:
#ISP CONFIGURATION
server {
listen 8805;
root /home/directory1/directory2/isp/;
location / {
allow 127.0.0.1;
deny all;
}
location ~ \.php$ {
limit_req zone=one burst=8;
try_files $uri =404;
fastcgi_index index.php;
fastcgi_pass php;
include fastcgi_params;
fastcgi_buffering on;
fastcgi_buffers 96 32k;
fastcgi_buffer_size 32k;
fastcgi_max_temp_file_size 0;
fastcgi_keep_conn on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
}
I have tried several Reverse Proxies but all gives me the same results. I think that there should be a way to do it as I have seen similar webservers as me with the same configuration which works fine.
Share Improve this question asked Nov 17, 2024 at 3:19 AniAni 11 Answer
Reset to default 0I think you can add proxy_set_header in location like this:
location / {
allow 127.0.0.1;
deny all;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
then nginx can pass client's host, client's real ip to bacnend server
本文标签: NginxHow to get the Real Client ISP instead of Reverse Proxy ISPStack Overflow
版权声明:本文标题:Nginx - How to get the Real Client ISP instead of Reverse Proxy ISP - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745639670a2160665.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论