Currently I have a NGINX proxy running that manages all domains and SSL certificates.
Now I want to access two NextCloud instances on one server (Apache, different paths) via different subdomains.
Eg.
app1.domain.com => http://ip-adress/nextcloud/instance1
app2.domain.com => http://ip-adress/nextcloud/instance2
On the Apache web server, I can access the applications directly via the path.
Proxy Config (foreach subdomain):
server {
server_name app1.domain.com
# HTTP configuration
listen 80;
listen [::]:80;
location / {
proxy_pass http://ip-adress:80;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 900;
}
}
SSL will later be managed by Certbot.
If the proxy_pass is
set to the adress (like in the snippet), I can access the site under app1.domain.com/nextcloud/instance1
If the proxy_pass ist
set to "http://ip-adress:80/nextcloud/instance1
" I get directed to /index.php
(which would be correct) but an 404.
If the proxy_pass ist
set to "http://ip-adress:80/nextcloud/instance1/
" I get directed to /nextcloud/instance1/index.php/login
" but also an 404.
Where ist
the mistake?