Since the last few days i am geeting an error in my swag container, saying the following:
nginx: [emerg] "stream" directive is not allowed here in /etc/nginx/conf.d/stream.conf:3
After deleting the stream.conf file from inside the container (e.g. not the user config files) the container works until the next update that breaks it again.
This is the content of the file:
# Specifies the main log format.
log_format main '$remote_addr [$time_local] '
'$protocol $status $bytes_sent $bytes_received '
'$session_time "$upstream_addr" '
'"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"';
access_log /var/log/nginx/stream.log main;
# Includes servers configs.
Now i find it unlikely that the whole swag container would be broken for everybody and not fixed over the course of 2-3 days, so i think this is somehow related to my setup. Basically i use swag to pull letsencrypt certificated and act as a reverse proxy for the apps on my network.
Does not appear to be unique to your setup, at least not unless we both have identical setups somehow.
I can confirm I just updated my docker compose stack with a fresh pull this morning and my working SWAG broke.
I am getting the same error as you are in the logs inside the SWAG container in /var/log/nginx/error.log I have line after line like this
[emerg] 605#605: “stream” directive is not allowed here in /etc/nginx/conf.d/stream.conf:3
[emerg] 610#610: “stream” directive is not allowed here in /etc/nginx/conf.d/stream.conf:3
[emerg] 615#615: “stream” directive is not allowed here in /etc/nginx/conf.d/stream.conf:3
After rm /etc/nginx/conf.d/stream.conf I can once again access heimdall and my other proxied services.
Had this issue also. Renamed the stream.conf file and rebooted the container and all is back normal for me. Will this occur every time swag updates? Can you elaborate for a newb " You have to update the nginx.conf and ssl.conf according to new sample files provided !" what exactly this process is?
If you look at the nginx.conf and ssl.conf files compared to the *.sample versions, you’ll see that the samples were updated in 2022. I’m assuming the old versions of these files are no longer compatible with the configuration, hence why the container isn’t running.
As I hadn’t made any customizations to either of these files in my install, I simply renamed up the old versions to *.bak, then copied the *.sample files and removed the .sample from the end. Once I rebooted the container, everything looks to be working correctly!
As a note to all of you, this solution with instructions, is in your container logs. How to get your container logs are referenced in the readme of every LSIO container. For the stream issue, it’s just nginx.conf that needs to be updated (due to an upstream alpine change), but you should check container logs anyway to ensure your configs are up to date.
Make sure you COMPARE old to new if you made any changes to the configs. User customization is why we don’t simply update the configs as this would cause users to lose data.