Reputation: 487
I need to use nextcloud with reverse proxy (virtual path), and i can't understand where i made a mistake. It is my config (after some simplifications)
server {
listen 80;
location ^~ /path/ {
proxy_redirect off;
proxy_set_header Host $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-Host $server_name;
proxy_pass http://nextcloud/;
}
}
Nextcloud is working correctly on path http://nextcloud/
, but on http://my-domain/path
it is not working.
I think, this is happening because it is necessary to set HTTP_X_FORWARDED_FOR
header, but i can not find any usage example. Can anybody help?
It is documentation about nextcloud reverse proxy.
Upvotes: 2
Views: 2851
Reputation: 48
You don't need to change nginx config. There is special parameter for proxy in nextcloud config.php - overwritewebroot
. See https://doc.owncloud.org/server/8.1/admin_manual/configuration_server/config_sample_php_parameters.html
Upvotes: 3