YunoHost-Apps / nextcloud_ynh

Nextcloud package for YunoHost
https://nextcloud.com/
GNU Affero General Public License v3.0
144 stars 62 forks source link

Nginx fails to start at server boot because of the nextcloud nginx config #667

Open OniriCorpe opened 4 months ago

OniriCorpe commented 4 months ago

Describe the bug

nginx crashes at server boot

nginx -t and the systemctl log return this error : nginx: [warn] duplicate extension "js", content type: "text/javascript", previous content type: "application/javascript" in /etc/nginx/conf.d/nuage.emelyne.eu.d/nextcloud.conf:7

when i comment the following lines in my /etc/nginx/conf.d/nextcloud.example.com.d/nextcloud.conf, nginx start without any issue:

# include mime.types;
# types {
#    text/javascript js mjs;
# }

i don't know why these lines are here, so i don't patch the package and i open this issue

Context

Steps to reproduce

  1. have installed nextcloud
  2. maybe some fuckery somewhere???
  3. reboot the server
  4. nginx fails to start

Expected behavior

nginx starts successfully as usual

Logs

systemd[1]: Starting A high performance web server and a reverse proxy server...
nginx[2931]: nginx: [warn] duplicate extension "js", content type: "text/javascript", previous content type: "application/javascript" in /etc/nginx/conf.d/nuage.emelyne.eu.d/nextcloud.conf:7
systemd[1]: nginx.service: start-pre operation timed out. Terminating.
systemd[1]: nginx.service: Control process exited, code=killed, status=15/TERM
systemd[1]: nginx.service: Failed with result 'timeout'.
systemd[1]: Failed to start A high performance web server and a reverse proxy server.
CodeShakingSheep commented 4 months ago

I think I have a related issue. I have 2 Nextcloud apps on the same server. When running command nginx -t I see this

nginx: [warn] duplicate extension "js", content type: "text/javascript", previous content type: "application/javascript" in /etc/nginx/conf.d/nextcloud1.domain.tld.d/nextcloud.conf:7
nginx: [warn] duplicate extension "js", content type: "text/javascript", previous content type: "application/javascript" in /etc/nginx/conf.d/nextcloud2.domain.tld.d/nextcloud__2.conf:7

However, at server boot nginx starts correctly nevertheless. Still, I believe this warning should be fixed.