Hello,
I would like to setup Nginx reverse proxy on the server, but after setting vhost Nextcloud redirects me outside the proxy.
Scheme:
SNAP INSTALL: cloud.example.com:8443
Nginx vhost: cloud.example.com
server {
listen 80;
server_name cloud.example.com;
server_name_in_redirect off;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443 ssl;
server_name cloud.example.com;
ssl_certificate /etc/letsencrypt/live/cloud.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/cloud.example.com/privkey.pem;
location /.well-known {
alias /var/www/nextcloud/.well-known;
}
But after enabling this vhost I am unable to access Nextcloud through proxy because it redirects me to the snap installation (cloud.example.com:8443)
Can you help me with this issue?
Thank you,
Petr.