Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get passthrough of real IP to work #827

Closed
jerheij opened this issue Aug 6, 2019 · 1 comment
Closed

Can't get passthrough of real IP to work #827

jerheij opened this issue Aug 6, 2019 · 1 comment

Comments

@jerheij
Copy link

jerheij commented Aug 6, 2019

I've set-up my Nextcloud docker like this:
Internet > Nginx proxy > nextcloud nginx frontend > nextcloud app

OS: CentOS7 (up to date)
Docker: version 19.03.1, build 74b1e89
Nextcloud-app image: nextcloud:fpm-alpine
Nextcloud-web image: nginx:alpine

Nginx Proxy:
This is where I enable HTTPS, TLS, strong encryption and the whole shebang. I basically run this nginx proxy because I have several HTTP services on my VPS

Nextcloud nginx frontend:
Configuration from the installation instructions

Nextcloud app backend:
Nextcloud container

Everything works perfectly fine except for the passing on of the real IP. I've tested with putting my nginx r-proxy in Host mode, this made the right IPs (external / internet IPs) show up in his log files and it was also the last IP in the nginx frontend's log. But they still don't show up correctly in my Nextcloud app log. I've tested by adding the following to the config.php:

'trusted_proxies' => array('192.168.189.6','192.168.189.1','192.168.159.2','192.168.159.1'),
'forwarded_for_headers' => array('HTTP_X_FORWARDED_FOR'),

This still made the actual IP of the nginx frontend show up in my app log. The trusted proxy IPs are the IPs and gateways from the nextcloud app and the nextcloud nginx frontend.

What am I doing wrong? How can I make this setup, or a set up which is still secure enough to expose it to the internet, work with having bruteforce protection and fail2ban enabled?

I've read to all the related issues I could find and also through the installation instructions in the manual but nothing made this work for me.

@J0WI
Copy link
Contributor

J0WI commented Jun 5, 2020

Closing in favor of #1103

@J0WI J0WI closed this as completed Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants