Hi, I am sure I am missing something simple here.
I have had SWAG working on my unraid server for a long time now, with fail2ban and geoblocking working. There is one thing I cannot get to work - my proxy-conf files will work if they refer to an upstream app by IP, but not by hostname.
I will use Searxng as an example.
SWAG and Mealie are both in the same custom docker network. Mealie has hostname “searx” and SWAG is “swag”.
If I open a console in the SWAG container I can “ping searx” and get a response. So SWAG can clearly see that hostname.
In the proxy-conf files, searx.subdomain.conf works/doesn’t work as follows:
WORKS (LAN IP:port):
location / {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app 192.168.0.10;
set $upstream_port 8622;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_max_temp_file_size 2048m;
}
WORKS (container IP:port):
location / {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app 172.18.0.5;
set $upstream_port 8080;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_max_temp_file_size 2048m;
}
502 FAIL (container hostname:port)
location / {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app searx;
set $upstream_port 8080;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
proxy_max_temp_file_size 2048m;
}
Pinging “searx” works as follows:
root@bc3a264fd046:/# ping searx
PING searx (172.18.0.5): 56 data bytes
64 bytes from 172.18.0.5: seq=0 ttl=64 time=0.112 ms
64 bytes from 172.18.0.5: seq=1 ttl=64 time=0.052 ms
64 bytes from 172.18.0.5: seq=2 ttl=64 time=0.049 ms
^C
--- searx ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.049/0.071/0.112 ms
root@bc3a264fd046:/#
When I first set SWAG up, it took some effort, so it is possible I messed with some conf files in ways I don’t remember.
Am I correct that NGINX should be able to just use the hostname “searx” identically to the container IP address?