Rafa_F
July 10, 2013, 9:16am
1
Hi all !
When i use OpenVPN, my remote ip address detected by Nginx (not used on
reverse proxy) is different than Apache (standalone, just for test), or
http://whatismyipaddress.com , the ip detected by Nginx is my real ip
address, not the IP address of my VPN, so i cannot use allow/deny
function
correctly.
Could you please help me ?
My nginx.conf :
user www-data www-data;
worker_processes 2;
events {
worker_connections 1000;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/x-javascript text/xml
application/xml application/xml+rss text/javascript image/gif image/jpeg
image/png;
gzip_disable "MSIE [1-6].(?!.SV1)";
gzip_vary on;
server_tokens off;
include /etc/nginx/conf.d/ .conf;
include /etc/nginx/sites-enabled/*;
}
My vhost’s :
server {
server_name XXX.tld;
root /var/www/selfoss;
listen 443;
ssl on;
ssl_certificate /etc/nginx/mycert.crt;
ssl_certificate_key /etc/nginx/mykey.key;
index index.php;
access_log /var/log/nginx/selfoss-access.log;
error_log /var/log/nginx/selfoss-error.log;
location / {
allow XX.XX.XX.XX;
deny all;
try_files $uri /public/$uri /index.php$is_args$args;
}
location ~* \ (gif|jpg|png) {
expires 30d;
}
location ~ ^/favicons/.*$ {
try_files $uri /data/$uri;
}
location ~* ^/(data\/logs|data\/sqlite|config\.ini|\.ht) {
deny all;
}
location ~ \.php$ {
client_body_timeout 360;
send_timeout 360;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_intercept_errors on;
}
}
Thanks
Posted at Nginx Forum:
Hi all ! When i use OpenVPN, my remote ip address detected by Nginx (not used on reverse proxy) is different than Apache (standalone, just for test), or http://whatismyipaddress.com, the ip detected by Nginx is my real ip address, not the IP address...
wolfy
July 10, 2013, 1:23pm
2
the ip detected by Nginx is my real ip address, not the IP address of my
VPN, so i cannot use allow/deny function correctly.
Could you please help me ?
Your nginx/host IP is probably not routed via the VPN tunnel so you
access
it directly and it sees your real ip - so check the routes on your
client
box. There is nothing you can change in nginx.conf for that.
rr
wolfy
July 10, 2013, 7:59pm
3
I try to understand why with nginx my IP address is not that the IP
address
of my VPN, then with Apache, or any website to display my IP it works
correctly.
Posted at Nginx Forum:
Hi all ! When i use OpenVPN, my remote ip address detected by Nginx (not used on reverse proxy) is different than Apache (standalone, just for test), or http://whatismyipaddress.com, the ip detected by Nginx is my real ip address, not the IP address...
wolfy
July 12, 2013, 11:27am
4
From: wolfy [email protected]
Nobody can help me?
Maybe check the request headers…?
JD
wolfy
July 30, 2013, 12:52pm
6
I have the same problem.
Have you been able to find a solution to this? I believe it might need
to be
fixed on the vpn side.
The setup works OK if the vpn server and nginx server are on different
machines, but if they are on the same machine, it doesn’t work for me.
A more detailed description of the problem is here:
nginx, vpn, pptp, pptpd
Ustun
Posted at Nginx Forum:
Hi all ! When i use OpenVPN, my remote ip address detected by Nginx (not used on reverse proxy) is different than Apache (standalone, just for test), or http://whatismyipaddress.com, the ip detected by Nginx is my real ip address, not the IP address...