GithubHelp home page GithubHelp logo

Comments (5)

j7an avatar j7an commented on May 18, 2024 1

@evertramos I will try the configuration later this week. Hopefully with my validation we can do a PR for Cloudflare support.

from nginx-proxy-automation.

j7an avatar j7an commented on May 18, 2024 1

@evertramos Looks like I have a successful test using your suggested setup. This appears to be the same setup as Serverpilot's configuration. I have two Apache containers behind same Nginx proxy (one with Cloudflare and one without ). Both were able to detect the correct IP.

I will keep the setup running for a few days and let you know if there's any issues.

from nginx-proxy-automation.

evertramos avatar evertramos commented on May 18, 2024

Hello @j7an!

I am not quiet sure how we can do that, but as far as I could understand, we must have one setting for the header, so let´s try to set your `realip.conf´ with the following information:

set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;

real_ip_header X-Forwarded-For;

I have removed the IPv6 for testing purpose as well. And you might get the docker network ip address but in that case you must check the header sent to the app container under the option X-Forwarded-For.

from nginx-proxy-automation.

j7an avatar j7an commented on May 18, 2024

@evertramos Thanks! I will try that and post back my findings. ServerPilot's configuration might provide additional hints as they're using Nginx as a proxy for Apache.

from nginx-proxy-automation.

evertramos avatar evertramos commented on May 18, 2024

@j7an

I have tested with only one option X-Real-IP or X-Forwarded-For it seems to forward the real ip to the container in the request's header. And testing with a vpn of my own it did forward the real ip to the service container, in that case the vpn ip.

I could not get both values to work together...

Did you manage it to work? I will test it with Cloudflare over the weekend as well to see if it works.

from nginx-proxy-automation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.