Hello.
I’m running the latest SWAG via Docker Desktop (under Linux/Fedora), and I just can’t get the real IP address for connections going through the proxy. All I get is the container IP address (192.168.65.1).
My compose file looks like this:
services:
swag:
image: lscr.io/linuxserver/swag
container_name: swag
cap_add:
- NET_ADMIN
environment:
- PUID=1000
- PGID=1000
- TZ=America/Toronto
- URL=mydomain.com
- SUBDOMAINS=mysubdomain,
- VALIDATION=http
- ONLY_SUBDOMAINS=true
- STAGING=false
- DISABLE_F2B=true
- EMAIL=myemail@mydomain.com
volumes:
- /home/myusername/Documents/Docker/swag/config:/config
ports:
- 443:443
- 80:80
restart: unless-stopped
The proxy’s config looks like this (this points to a server running a native service on port 80, not another container):
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name mysubdomain.mydomain.com;
include /config/nginx/ssl.conf;
client_max_body_size 0;
location / {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app 10.20.55.25;
set $upstream_port 80;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
}
I can connect to the server without issue and everything is working like it should. The only issue I have is that all of the access logs show the same IP address for all connections (the container IP address).
How do I get the real ip address for connections to show up in the logs?
Any advice would be appreciated.
Thanks,
Kristin.