Weird issue when running OCIS behind Nginx
Describe the bug
I've set up nginx as a reverse proxy in front of OCIS. When I point my browser to https://localhost:9200/, everything works. I can login as admin and upload files.
When I try to go through nginx, on the other hand, things get weird. It downloads the main page, then downloads most of that page's requests via the nginx proxy just fine. But for two files -- /app/list and /themes/owncloud/theme.json -- it tries to get them from https://localhost:9200. One is an XHR attempt; the other is a fetch. These fail due to CORS. The page gives a config error.
I'm doing a simple test of OCIS on my laptop, so I'm not using docker, DNS, or TLS.
Steps to reproduce
-
run
ocis server -
Configure NGINX as a reverse proxy:
location / {
proxy_pass https://localhost:9200;
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-Proto $scheme;
proxy_pass_request_headers on;
}
- Point your browser to your IP address (not localhost) running nginx:
http://192.168.0.12/
Expected behavior
Expected OwnCloud to load.
Actual behavior
Those two files fail to load, and the whole thing fails with a config error.
Setup
Just plain ocis server on the static binary. I haven't yet made it far enough into OCIS to be messing around with environment variables and such. It's a standard, fresh ocis init setup.