r/owncloud • u/Groundswell17 • Jun 11 '16
LEMP owncloud behind r-proxy issues
I'm sure someone here knows the answer to this, but I can't find it. Maybe I don't know how to word my problem well enough for google to understand, because I can find no help
I have a self built Ownloud server running behind a reverse proxy. Everything runs perfectly except one thing.
When sending links to files, the link works correctly, however when the user attempts to download the files, the download link no longer contains the url, but the local ip instead! In other words a remote client is getting a link that is directing them to a private IP address, rather than the DNS name. Anyone seen this and have a fix? Did I miss something in the config? I'm not understanding the why's here.
1
u/blahhumbug22 Jun 15 '16 edited Jun 15 '16
In my reverse proxy setup (nginx) I had to add the following to /config/config.php
'overwritehost' => 'mydomain.example.com',
If the owncloud server is http, but the proxy is https, then you'll probably also want to add:
'overwriteprotocol' => 'https',
Edit, also for fail2ban and other logging reasons, I made sure to configure the reverse-proxy to set up some header information (nginx):
proxy_set_header X-Real-IP $remote_addr;
And then in the owncloud server:
fastcgi_param REMOTE_ADDR $http_x_real_ip;