-
-
Notifications
You must be signed in to change notification settings - Fork 174
Add TRUSTED_PROXY support & global imports #643
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
base: main
Are you sure you want to change the base?
Conversation
Updated documentation and configuration files to improve trusted proxy handling. Introduced customizable trusted proxy settings for Cloudflare, Sucuri, and local proxies, ensuring accurate IP logging. Removed hardcoded Cloudflare IPs from NGINX and Apache configurations, replacing them with a dynamic inclusion based on the TRUSTED_PROXY environment variable.
|
One recommendation would be for local to be somehow tied into cloudflare/sucuri. With this new implementation, if I have my site behind cloudflare, but also running in docker (behind traefik/caddy), then i shouldnt have to pick/choose if i want both Not sure what the best way to do this, but i do feel like a docker setup is very common |
Updated the documentation to specify that both Cloudflare and Sucuri configurations now automatically include local Docker networks. Added a tip to inform users that they can use the `cloudflare` setting while also trusting local proxies, enhancing clarity on trusted proxy usage.
Deploying serversideup-php with
|
| Latest commit: |
b172d24
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e5b52b40.serversideup-php.pages.dev |
| Branch Preview URL: | https://improvement-webserver-config.serversideup-php.pages.dev |
|
Valid point! If you check the file, you'll see that when you set
I just added some docs to make it clearer 😃 Next stepsIf you want to test out using the images in the top comment, let me know if you're getting your expected results 👍 |
Updated the Dockerfile to create a directory for global Caddy configurations and modified the Caddyfile to import additional configuration files from the new caddyfile-global.d directory, enhancing flexibility in Caddy setup.
How to test this image
Use the
serversideup/php-devimages that are tagged with this PR number:serversideup/php-dev:643-*View the images →
What this PR does
Add
TRUSTED_PROXYsupportYou can now customize your trusted proxy experience via environment variables.
cloudflare(default)CF-Connecting-IPheadersucuriX-Forwarded-ForheaderlocalX-Forwarded-ForheaderoffGlobal Imports for FrankenPHP
Instead of using
${CADDY_GLOBAL_OPTIONS}variable (which can be a pain with escaping characters, etc) you can now just import configurations into the global block by copying Caddyfiles over to/etc/frankenphp/caddyfile-global.d/.Caddy will load any
*.caddyfilefiles:docker-php/src/variations/frankenphp/etc/frankenphp/Caddyfile
Lines 22 to 23 in 5d5d7a9