Wrong nginx.conf

Hello I’m using HA 2025.1.4 and have plugins Let’s Encrypt (5.2.10) and NGINX Home Assistant SSL proxy (3.11.1). The issue is that whatever I configure, I can see that the file /etc/nginx.conf is generated from configurations, has good content, but event though the server starts with “nginx -c /etc/nginx.conf” I can see, with “nginx -T” that it uses /etc/nginx/nginx.conf. I don’t understand why, and of course doing so, it ignores my settings and the nginx does not work as expected.

Any help is welcome. Greeting Tim Mickelson

Where are you running that command?

You are supposed to put your specific configuration in “/share”, and those are read by the main nginx.conf, so it is not clear what you mean by I can see that the file /etc/nginx.conf is generated from configurations, has good content

In the share, I would have custom configurations if “active: true” they would be found in the default and servers section. I have put nothing there, I have only the settings from standard configuration. This configuration is the used with the template /etc/nginx/nginx.conf.gtpl that will create from the settings a /etc/nginx.conf every time we save. The script /etc/s6-overlay/s6-rc.d/nginx/run is run on every restart and the last line is “exec nginx -c /etc/nginx.conf < /dev/null” and a ps aux shows this. But for some reason “nginx -T” shows me that I’m using /etc/nginx/nginx.conf instead, that is wrong. Everything is within the addon docker container addon_core_nginx_proxy where the nginx server is running.

In short, the standard configurations are correctly used to create /etc/nginx.conf, the application is started pointing to this config “nginx -c /etc/nginx.con” But in my setup for whatever reason I don’t know, if I run “nginx -T” I can clearly see that it is using the default configuration “/etc/nginx/nginx.conf” and this is my issue.

/etc/nginx.conf is created at +17 addons/nginx_proxy/rootfs/etc/s6-overlay/s6-rc.d/nginx/run at master · home-assistant/addons · GitHub

It is started with custom config at +57 in the same “run” file.

This is my output from docker container:

core-nginx-proxy:/# nginx -T | head -10
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# configuration file /etc/nginx/nginx.conf:
# /etc/nginx/nginx.conf

/etc/nginx.conf is not a default location, so if you don’t specify “-c”, it will test the first conf it finds in its default locations, which is /etc/nginx/nginx.conf, although that’s not the one which is ran by the addon.

“-t” doesn’t talk to the running instance.

@koying You are correct, I totally missed that “nginx -T” is not the running instance. My issue has nothing to do with this, I’m on a wild goose chaise. Thank you for this input, now I will resolve my issue and if not open a completely different thread.