I've setup a reverse proxy and everything seems to be functionally fine however it looks like nginx is not correctly registering remote visit IP addresses and logs everything as coming from my server WAN IP, which wouldnt be a problem however one of the services im running is shlink which needs the remote IP to be passed in order to log locations
I'm running nginx via a SWAG docker in docker compose if that helps troubleshoot
An example below are all remote requests various devices and they are all being registered from the servers WAN IP
202.63.68.112 - - [19/May/2022:10:28:57 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 65536 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1"
202.63.68.112 - - [19/May/2022:10:28:59 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 7302130 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1"
202.63.68.112 - - [19/May/2022:10:29:01 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 65536 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1"
202.63.68.112 - - [19/May/2022:10:29:03 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 5045234 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1"
202.63.68.112 - - [19/May/2022:10:29:03 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 14906904 "-" "Mozilla/5.0 (Linux; Android 12; SM-G981U1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.61 Mobile Safari/537.36"
202.63.68.112 - - [19/May/2022:10:29:05 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 65536 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1"
202.63.68.112 - - [19/May/2022:10:29:06 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 5041138 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1"
202.63.68.112 - - [19/May/2022:10:29:08 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 65536 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1"
202.63.68.112 - - [19/May/2022:10:29:10 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 6204402 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1"
202.63.68.112 - - [19/May/2022:10:29:10 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 65536 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1"
202.63.68.112 - - [19/May/2022:10:29:12 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 65536 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1"
202.63.68.112 - - [19/May/2022:10:29:12 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 3947506 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1"
202.63.68.112 - - [19/May/2022:10:29:22 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 22035471 "-" "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-G981U1) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36"
202.63.68.112 - - [19/May/2022:10:29:22 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 499 0 "-" "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-G981U1) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36"
202.63.68.112 - - [19/May/2022:10:29:22 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 499 0 "-" "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-G981U1) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36"
202.63.68.112 - - [19/May/2022:10:29:22 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 499 0 "-" "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-G981U1) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36"
202.63.68.112 - - [19/May/2022:10:29:22 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 499 0 "-" "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-G981U1) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36"
202.63.68.112 - - [19/May/2022:10:29:22 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 499 0 "-" "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-G981U1) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36"
202.63.68.112 - - [19/May/2022:10:29:23 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 2923535 "-" "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-G981U1) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36"
202.63.68.112 - - [19/May/2022:10:29:23 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 499 0 "-" "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-G981U1) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36"
202.63.68.112 - - [19/May/2022:10:29:23 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 499 0 "-" "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-G981U1) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36"
202.63.68.112 - - [19/May/2022:10:29:23 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 499 0 "-" "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-G981U1) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36"
202.63.68.112 - - [19/May/2022:10:29:23 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 499 0 "-" "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-G981U1) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36"
202.63.68.112 - - [19/May/2022:10:29:24 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 499 0 "-" "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-G981U1) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36"
202.63.68.112 - - [19/May/2022:10:29:24 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 499 0 "-" "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-G981U1) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36"
202.63.68.112 - - [19/May/2022:10:29:24 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 21001752 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1"
202.63.68.112 - - [19/May/2022:10:29:26 +1000] "GET /index.php/s/dGZegTxeeeMmro2/download HTTP/2.0" 206 4140047 "-" "Mozilla/5.0 (Linux; Android 12; SAMSUNG SM-G981U1) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/17.0 Chrome/96.0.4664.104 Mobile Safari/537.36"
I have setup X forwarded for in the config below:
#### proxy.conf
---------------
# Proxy Connection Settings
proxy_buffers 32 4k;
proxy_connect_timeout 240;
proxy_headers_hash_bucket_size 128;
proxy_headers_hash_max_size 1024;
proxy_http_version 1.1;
proxy_read_timeout 240;
proxy_redirect http:// $scheme://;
proxy_send_timeout 240;
# Proxy Cache and Cookie Settings
proxy_cache_bypass $cookie_session;
#proxy_cookie_path / "/; Secure"; # enable at your own risk, may break certain apps
proxy_no_cache $cookie_session;
# Proxy Header Settings
proxy_set_header Connection $connection_upgrade;
proxy_set_header Early-Data $ssl_early_data;
proxy_set_header Host $host;
proxy_set_header Proxy "";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Real-IP $remote_addr;
#### domain.subdomain.conf
---------------
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name domain.au;
include /config/nginx/ssl.conf;
client_max_body_size 0;
location / {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app shlink;
set $upstream_port 8080;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
}
Any ideas what I've done wrong?