owncloud / owncloud/ocis

Weird issue when running OCIS behind Nginx

Open
#11,619 4 comments 0 reactions 0 assignees View on GitHub
Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 1h
Merged PRs (30d)
103

Description

## 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

1. run `ocis server`

2. 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;
}
```

3. 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.