Docker-Webstack icon indicating copy to clipboard operation
Docker-Webstack copied to clipboard

Fix nginx config by removing http.d config

Open blackshadev opened this issue 3 years ago • 2 comments
trafficstars

It seems like nginx now stores the config of the default.conf site in http.d instead of conf.d . Which causes nginx to shutdown with the following error

2022/07/24 18:48:00 [emerg] 920#920: a duplicate default server for 0.0.0.0:80 in /etc/nginx/http.d/default.conf:5

I observed this on the 8.1 docker image, But for good measure I added the same statements to all versions: Delete all the things.

blackshadev avatar Jul 24 '22 18:07 blackshadev

@blackshadev nice find!

I cannot reproduce Nginx shutting down locally, since a custom nginx.conf is put into place that completely ignores the /etc/nginx/http.d directory and instead loads from the conf.d directory: https://github.com/eXistenZNL/Docker-Webstack/blob/master/files/general/etc/nginx/nginx.conf#L65

Did you find this issue after you added your own custom nginx.conf? I believe that now the /etc/nginx/http.d survives the cleaning command, it can have some side effects once you override nginx.conf with a version that wants to load from the http.d folder.

Anyhow, now that /etc/nginx/conf.d no longer exists, would you mind removing that from the rm -rf command? Also the nginx.conf file in this repo should probably be updated to load from /etc/nginx/http.d instead of /etc/nginx/conf.d (Line 65) since that folder does not exist in the first place, wouldn't you agree?

eXistenZNL avatar Sep 01 '22 14:09 eXistenZNL

Sure, done

blackshadev avatar Sep 01 '22 18:09 blackshadev

@blackshadev would you mind updating the nginx.conf as well? :+1:

Also the nginx.conf file in this repo should probably be updated to load from /etc/nginx/http.d instead of /etc/nginx/conf.d (Line 65) since that folder does not exist in the first place, wouldn't you agree?

eXistenZNL avatar Sep 02 '22 10:09 eXistenZNL

Done.

Due to the seer amount of text in your first comment I was unable to process the whole request at once and stopped at the first incling of my braining going "I think he means this"

blackshadev avatar Sep 04 '22 12:09 blackshadev

HTTP/1.1 413 Request Entity Too Large :D

eXistenZNL avatar Sep 06 '22 13:09 eXistenZNL

Merged, thanks for the contribution!

eXistenZNL avatar Sep 06 '22 13:09 eXistenZNL