-
-
Notifications
You must be signed in to change notification settings - Fork 634
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
Usage with Cloudflare proxy #238
Comments
Using cloudflare the letsencrypt certificates will not be renewed unless you bypass the cloudflare proxy. You could disable the letsencrypt removing the LETSENCRYPT_HOST option and uncomment the USE_NGINX_CONF_FILES in your .env file. It will add the cloudflare real ip forwarding to you container in case you need it. |
I have a script that will open source it soon, just waiting the sponsor to validate which disable the proxy update the ssl and activate the proxy again, doing automatically using cron, but might take a while to post it. |
I am aware of this limitation that I can not renew the lets encrypt certificates while behind the cloudflare proxy. This is not ideal but I can work around this. However, my issue seems to be different. I have a valid lets encrypt cert but can not use it along with grafana, this proxy and cloudflare. I get the "This page isn't redirecting properly" on my browser. Same thing happening with a MinIO docker container. Do you have any suggestion for this issue? Thank you for your work on this great script. |
it works if you bypass the proxy but it does if you activate the proxy is that what's happening? I had this issue when starting to work with cloudflare... I will try to remember but think it was a cloudflare config for that matter. |
what the log says in proxy and grafana container? |
If I do not use the Cloudflare proxy it works. I can make a https request with a valid lets encrypt certification. If I activate the Cloudflare proxy I get "This page isn't redirecting properly" in my browser. The nginx-proxy logs
The grafana docker container logs do not show any requests. It usually logs all http requests so I assume the calls do not reach the grafana container. |
This is more related to the CloudFlare configuration than this proxy. Check the page rules and the tls options... |
I have pretty much tried every SSL related page rule. Even disabling SSL It is always the same unfortunately. |
Disabling LETSENCRYPT_HOST on the docker container makes it work again. It just unfortunate that it seems I can not use Lets Encrypt to encrypt the traffic from Cloudflare to my server |
I will try to check on that and see how to use both! |
Hi just asking if you have been able to check on this. I have been trying some custom nginx configs to stop the infinite redirects but did not have any luck. I would love to be able to use Cloudflare with its DDOS protection and this useful nginx proxy. I tried the minio, grafana and docker-elk. All end up with infinite redirects from nginx-web as soon as I toggle the Cloudflare proxy |
Hello, I would like to share my own experience. I used to get these infinite redirects too. After much fiddling, I got it to work. I did this for both the previous version (0.4) and the one that just came out yesterday (v2). My setup on Cloudflare:
With the latest version, just run the Note: Make sure to add the DNS for A record and set it to Proxied (Orange Cloud). |
With |
It works!! Thank you very much!!! Now nextcloud container, does not see original client IP, it sees the Cloudflare IP as connected client. I have added Cloudflare IP's to trusted proxies, but they have no effect:
Not sure if there is a solution for this, but I would like to find one. |
Oh, I had to put |
@adrianharabula when you set true to use nginx conf files it will activate this configurations: https://github.com/evertramos/nginx-proxy-automation/blob/master/conf.d/realip.conf |
I can't do this. I tried using docker compose: version: "3"
services:
dozzle:
container_name: dozzle
image: amir20/dozzle:latest
environment:
- VIRTUAL_HOST=xyz
- LETSENCRYPT_HOST=xyz
- VIRTUAL_PORT=8080
- LETSENCRYPT_EMAIL=xyz
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8080:8080
networks:
default:
external:
name: ${NETWORK:-proxy} But I still get 500 from nginx. I know that it work before, because other devs used this way, but I don't know why it stop working |
In my env file I define my IP to the public IP of the server.
I can run a docker container and I can access it from the specified domain with HTTPS and a valid Lets-Encrypt certificate.
Now I switch my Cloudflare toggle to proxy all requests to my webserver. This results in a "This page isn't redirecting properly" error and I can no longer access the docker container.
I would like to know how to setup Cloudflare and this proxy to properly work together.
Example container:
The text was updated successfully, but these errors were encountered: