0

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?

Veera Nagireddy
  • 523
  • 2
  • 6
  • When using the default ports for HTTP (or HTTPS for that matter) you should not include a port number in the URI , in other words: when accessing a web server over plain http on the default port 80, do not use `http://ip-adress:80/nextcloud/instance1` but `http://ip-adress/nextcloud/instance1` - https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.3 – HBruijn Jul 04 '23 at 14:55
  • Hi, thanks for the information and the link! But unfortunately this doesn't change anything. – Patrick Jul 05 '23 at 06:34

0 Answers0