funkwhale : reload nginx failing when using http only
I am running the following, reproducible with vagrant:
Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.define "funkwhale"
config.vm.hostname = "funkwhale"
config.vm.box = "generic/debian12"
end
Playbook:
- hosts: funkwhale-servers
roles:
- role: funkwhale
funkwhale_hostname: funkwhale.local
funkwhale_letsencrypt_email: harri@krishna.com
funkwhale_protocol: http
funkwhale_letsencrypt_enabled: false
this yields the error:
RUNNING HANDLER [funkwhale : reload nginx] **************************************************************************************************************************************************************************
fatal: [vagrant@192.168.121.239]: FAILED! => {"changed": false, "msg": "Unable to reload service nginx: Job for nginx.service failed.\nSee \"systemctl status nginx.service\" and \"journalctl -xeu nginx.service\" for details.\n"}
It is probably because the /etc/nginx/sites-enabled/funkwhale.local.conf
looks like this
note, I will omit the full server block for 443 as you get the point probably.
upstream funkwhale-api {
server 127.0.0.1:5000;
}
server {
listen 80;
listen [::]:80;
server_name funkwhale.local;
location /.well-known/ {
allow all;
include /etc/nginx/funkwhale_proxy.conf;
proxy_pass http://127.0.0.1:5000/.well-known/;
}
location / {
return 301 https://$host$request_uri;
}
}
# Required for websocket support.
map $http_upgrade $funkwhale_connection_upgrade {
default upgrade;
'' close;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
charset utf-8;
server_name funkwhale.local;
ssl_certificate /etc/letsencrypt/live/funkwhale.local/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/funkwhale.local/privkey.pem;
### REST OF BLOCK OMITTED