Update NGINX installation from v1.22.1 to 1.29.8 + QOL#62
Conversation
Current NGINX version installed is 1.22.1 which released in 2022 this follows https://nginx.org/en/linux_packages.html#Debian to install mainline NGINX packages
Redirect NGINX error logs to stderr.
Commented out the console access log line with a note about its verbosity.
Comment out access and error log directives to prevent overriding existing configurations.
Removed manual trigger for workflow dispatch.
|
Thank you for your contribution. I will take a look at everything and test it over the weekend. |
- Fix set_real_ip_from 127.0.0.1 since requests arrive from the local cloudflared process, not from the Docker network - Use CF-Connecting-IP header to correctly resolve the real client IP set by Cloudflare
Ym0T
left a comment
There was a problem hiding this comment.
Thanks for the contribution! I adjusted the real IP configuration slightly since Cloudflare Tunnel runs inside the container itself, requests to nginx always arrive from 127.0.0.1 (the local cloudflared process), not from the Docker network (172.18.0.0/16). I also switched the header from X-Forwarded-For to CF-Connecting-IP which is the header Cloudflare sets with the actual client IP. Everything else looks good and has been included!
Huh weird sorry for missing that. When I was testing my changes 172.18.0.0/16 worked fine and I guess I didn't investigate it further. |
No worries! I tested both configurations on my test server running WordPress with Cloudflare Tunnel using standard Pterodactyl/Docker configurations and your version with 172.18.0.0/16 didn't work, the real IP was never resolved and all requests showed 127.0.0.1 in the logs. I was also wondering why the Docker network range would even be used here, since Cloudflare Tunnel runs inside the container itself and therefore all requests to nginx come from 127.0.0.1 directly. Either way, switching to set_real_ip_from 127.0.0.1 with CF-Connecting-IP fixed it immediately and should work reliably for everyone using Cloudflare Tunnel with the standard setup of this egg. |
I figured it out on my end requests are coming from 172.18.0.1 when I use cloudflared tunnel built into this egg not 127.0.0.1 that is why it was working on my end when I was making my changes. |
-e /dev/stderrto startup for better startup error logging./dev/stderrand/dev/stdoutwork in pterodactyl due to it merging both into the same console output.I have tested these changes via ghcr.io/frerduro/pterodactyl-nginx-egg:8.5-latest and have not found any issues so far.