owncloud / ocis

:atom_symbol: ownCloud Infinite Scale Stack
https://doc.owncloud.com/ocis/next/
Apache License 2.0
1.37k stars 180 forks source link

Reverse proxying with a URL path different than / #5478

Open marblestation opened 1 year ago

marblestation commented 1 year ago

Different OCIS services have configuration parameters that seem to provide the option to allow serving to a public URL such as https://domain/data/, so that a proxy could receive this requests and redirect them to OCIS. Nevertheless, I could not find in the documentation what is the proper setup and none of my multiple attempts worked.

For instance, I have an nginx configured with:

     location /{
        #rewrite /data/(.*) /$1  break;
        proxy_pass         http://localhost:9200;
        proxy_redirect     off;
        proxy_set_header   Host $host;
    }

And I tried running OCIS server with multiple combination of parameters, such as:

WEB_HTTP_ROOT=/data/ PROXY_TLS=false PROXY_HTTP_ADDR=0.0.0.0:9200 OCIS_URL=https://domain/ ./bin/ocis server
PROXY_HTTP_ROOT=/data/ PROXY_TLS=false PROXY_HTTP_ADDR=0.0.0.0:9200 OCIS_URL=https://domain/ ./bin/ocis server

But none has worked (I tried OCIS 2.0.0). I can get some responses if I remove these *_ROOT environment variables and I make nginx remove the /data/ section from the URL, but then the response that I get back contains links to css or javascript (and others) without that /data/, thus returning 404 to the browser.

If this functionality is available, it would be convenient to provide an example in the documentation. Otherwise, it would be nice to have this feature implemented so that we are not forced to create subdomains for each self-hosted OCIS.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

sk1ddy commented 1 year ago

I am also interested in this. The official documentation lacks proper examples in case one wants to run OCIS behind a reverse proxy but at a sub-path (e.g., https://myserver.com/ocis) instead of the server root '/'. The latter configuration works for me, but I would like to know how to adapt it in case I want to move my ocis server to a sub-path.

TermeHansen commented 1 year ago

I agree, I would like this feature....

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

skwde commented 7 months ago

Also interested in that. I also didn't find any configuration option especially regarding the ocis container deployment.

(For owncloud 10 I found at somepoint somewhere the variable OWNCLOUD_SUB_URL=/owncloud to serve under https://mydomain.com/owncloud.)

chrismaster commented 4 days ago

Is there a way to configure the path? Someone can give a Yes/No