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

Add trusted proxies to docs #1086

Merged
merged 3 commits into from
Sep 7, 2024
Merged

Add trusted proxies to docs #1086

merged 3 commits into from
Sep 7, 2024

Conversation

melroy89
Copy link
Member

@melroy89 melroy89 commented Sep 4, 2024

See title.

@melroy89 melroy89 added the documentation Improvements or additions to documentation label Sep 4, 2024
@melroy89 melroy89 enabled auto-merge (squash) September 4, 2024 18:46
Copy link
Member

@BentiGorlich BentiGorlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some information regarding docker? Because with the www container it is a bit special isnt it?

@melroy89
Copy link
Member Author

melroy89 commented Sep 5, 2024

Can you add some information regarding docker? Because with the www container it is a bit special isnt it?

This is a complex question indeed.

Since we are talking about Docker, I believe that the trusted_proxy env var in Symfony should be: 172.16.0.0/12 (or any static IP you might give Caddy service within the docker external network). Unless you change the default IP ranges in your /etc/docker/daemon.json config (default-address-pools config and bip config).

We already have php_fastcgi {$PHP_FASTCGI_HOST} in place at: https://github.com/MbinOrg/mbin/blob/main/docker/caddy/Caddyfile. I believe that should pass the host correctly to Symfony?

I'm personally a bit confused whether we might even need set trusted_proxies within the Caddy config: https://caddyserver.com/docs/caddyfile/options#trusted-proxies

Then read also the defaults section: https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#defaults.

I must say I'm not running the Docker setup at the moment, so I'm unable to validate these configs in a real-world scenario to be fully honest.

Finally, we also have this rework in place, which might change everything again: #1085

@BentiGorlich
Copy link
Member

So maybe a follow up issue then?

@melroy89
Copy link
Member Author

melroy89 commented Sep 5, 2024

So maybe a follow up issue then?

That would be easier yes.

@melroy89
Copy link
Member Author

melroy89 commented Sep 5, 2024

Or we just add to use 172.16.0.0/12 as trusted_proxy under Docker? And fingers-crossed it works for most people...

@melroy89
Copy link
Member Author

melroy89 commented Sep 5, 2024

Or we just add to use 172.16.0.0/12 as trusted_proxy under Docker? And fingers-crossed it works for most people...

but then again, it doesn't fit the Nginx section here. And in the other PR we are also changing the docs for Docker.

@melroy89 melroy89 merged commit 6ec8e1e into main Sep 7, 2024
7 checks passed
@melroy89 melroy89 deleted the add_trusted_proxies_docs branch September 7, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants