location {{ nextcloud_url }} { proxy_pass http://127.0.0.1:{{ apache_port }}{{ nextcloud_url }}; } location ~ {{ nextcloud_url }}/.*\.php$ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://127.0.0.1:{{ apache_port }}; }