Nginx reverse proxy for nextcloud not work

Viewed 2511

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. enter image description here

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.

1 Answers
Related