So i have been trying to learn NPM.
I have got it mostly working, even got https certs.
I have several app working on subdomains as a test but i just cant figure how to access my old nextcloud instance
It was built with the auto installation script by @dan (im fairly sure).
If i point my router directly to the ip:port of the nextcloud instance it works fine as it has been for ages.
But if i set the router to point to NPM and i have a proxy host in NPM pointing to the nextcloud IP im getting Bad gateway Error code 502

root@nextcloud2:~ # cat /usr/local/www/Caddyfile
{
# debug
#acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
email bob@bob.co.uk
# default_sni bob.co.uk
}
bob.co.uk, localhost {
root * /usr/local/www/nextcloud
file_server
log {
output file /var/log/bob.co.uk.log
}
php_fastcgi 127.0.0.1:9000 {
env front_controller_active true
}
tls {
protocols tls1.2 tls1.3
}
header {
# enable HSTS
# Strict-Transport-Security max-age=31536000;
}
# client support (e.g. os x calendar / contacts)
redir /.well-known/carddav /remote.php/dav/ 301
redir /.well-known/caldav /remote.php/dav/ 301
redir /.well-known/webfinger /index.php/.well-known/webfinger 301
redir /.well-known/nodeinfo /index.php/.well-known/nodeinfo 301
# Required for legacy
@notlegacy {
path *.php
not path /index*
not path /remote*
not path /public*
not path /cron*
not path /core/ajax/update*
not path /status*
not path /ocs/v1*
not path /ocs/v2*
not path /updater/*
not path /ocs-provider/*
not path */richdocumentscode/proxy*
}
rewrite @notlegacy /index.php{uri}
# .htaccess / data / config / ... shouldn't be accessible from outside
@forbidden {
path /.htaccess
path /data/*
path /config/*
path /db_structure
path /.xml
path /README
path /3rdparty/*
path /lib/*
path /templates/*
path /occ
path /console.php
}
respond @forbidden 404
}
root@nextcloud2:~ #
I followed Nginx Proxy Manager | Dan's Wiki and as i say i got a handful of apps working through NPM with HTTPS, some on truenas core and some on a separate server truenas scale, but i can not do it for the old nextcloud
I eventual will swap to scale but im still testing and tinkering so i need to be able to switch nextcloud back and forth between NPM and direct forward from router, for now.