Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to set a custom webroot for reverse proxying on different url base path ? #1669

Open
Dark4Codrutz opened this issue Mar 21, 2024 · 1 comment

Comments

@Dark4Codrutz
Copy link

as the title suggests, I was trying to figure out if OITC exposes some variable that overwrites app's requests base url.

What I need to achieve is to have OITC webapp GET requests get redirected to the correct URL path when running behind a reverse proxy with a prefix.

For example:
I am reverse proxying OITC from www.website.com/monitor.
As soon as the webapp loads it queries for www.website.com/users/login instead of www.website.com/monitor/users/login.

In the past I've been able to solve these kind of cases, where webapp uses absolute paths instead of relative paths, by configuring the webapp to use a different base url path, changing the default / to /monitor as per my example.

For php I've seen nextcloud doing it like this
https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/reverse_proxy_configuration.html#overwrite-parameters

Is there anything similar available in OITC ?

@ibering
Copy link
Member

ibering commented Mar 22, 2024

Hi @Dark4Codrutz

Currently wo do not have such an configuration option.

I would recommend to go with an subdomain like monitor.website.com. This does not require any hacks for configuration changes

If you really like to tinker around, we do something similar with our internal Grafana. (sub_filter).

#Proxy for Grafana (external requests done by Web browsers)
# Not used by API Requests of openITCOCKPIT
location ^~ /grafana/ {
# Send request to authentication code first
auth_request /auth_grafana;
auth_request_set $auth_status $upstream_status;
proxy_set_header X-WEBAUTH-USER viewer;
proxy_set_header Authorization "";
proxy_pass http://127.0.0.1:3033/;
sub_filter 'http://localhost:3033/grafana/' 'https://$host/grafana/';
sub_filter_once off;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants