July 10, 2013 03:16AM
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
Subject Author Posted

Problem with VPN IP address and Nginx

wolfy July 10, 2013 03:16AM

Re: Problem with VPN IP address and Nginx

Reinis Rozitis July 10, 2013 07:24AM

Re: Problem with VPN IP address and Nginx

wolfy July 10, 2013 01:59PM

Re: Problem with VPN IP address and Nginx

wolfy July 12, 2013 05:09AM

Re: Problem with VPN IP address and Nginx

jdm July 12, 2013 05:28AM

Re: Problem with VPN IP address and Nginx

ludwigvan July 30, 2013 06:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 251
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