-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Feature Request: Cloudflare Tunnel Support #80
Comments
Oh, and in a Proxmox/OpenStack scenario, this should allow for servers using private IP addresses, eliminating the cost and hassle of provisioning public IP addresses for ever server, assuming that the WPCD site and servers are in the same private IP subnet and can communicate directly that way. This could mean even more security since all incoming external traffic could be blocked on the WPCD servers. 😯 |
It's a cool idea but I don't think this is something that we can expect to be done anytime soon. (Plus I shudder to think about the support level that would be required if this was added and a user didn't quite understand what pushing the button did or accidentally triggered it and they suddenly lost access to their servers.) |
BTW, I have this working with a manual config under WPCD NGINX, following the instructions on the Cloudflare guide, with a bit of community guidance, and my own finagling:
NOTE: Much of this step could be done manually with the Cloudflare Dashboard as well, but inclusion into WPCD would be swell.
Cloudflared complained about some systemctl parameters, so I setup
From there, I could direct the site to the Tunnel ID in Cloudflare, set Cloudflare Encryption to "Flexible", and turn off HTTPS for the app in WPCD. WordPress didn't seem to like the HTTP to HTTPS handover though, and was leading to infinite redirect loops and mixed content until I added this directive to
To verify that everything was working correctly, I ran UPDATES:11/21/2022: Nginx fails to restart if the .sock file already exists. I updated the |
That is cool. Will have to try it out one of these days. |
Here's an enhanced snippet for
|
My suggestion would be to make it a two-step process where the user enables the tunnel through WPCD, and is then given the tunnel address that they can use for their site's DNS cname (and possibly add it as another copy-able line below the site's IP address). That way, the user needs to explicitly switch the site over if that's what they want to do. If they really want to block port 80 and 443, that should be their own choice, as a completely separate step... |
Another possible advantage of this that could impact all types of users, BTW, would be the ability to do quick/seamless server migrations and restorations, and possibly even fail-over, without needing to change the DNS (as long as the tunnel ID can follow the site between WPCD servers). Just dreaming... |
Hey team, congrats on making it to 5.1!
Okay, this might be a bit "far out", but I've known this team to be ambitious, so here goes...
Cloudflare Tunnels are free. This allows a server to serve websites directly through Cloudflare without allowing any other ingress HTTP/HTTPS traffic. This translates to no direct external traffic to your machine that doesn't first pass through Cloudflare WAF (with the exception of SSH for WPCD, of course).
Additionally, this provides a secure way for the web the server to serve to Cloudflare using HTTP rather than HTTPS, avoiding the overhead of SSL, and the maintenance liability of certificate management and renewals. Cloudflare provides and manages public-facing certificates on your behalf, so no problems there.
Taken a step further, both the webserver* and the Cloudflare Tunnel* could be configured to connect to each other through a Unix socket, further eliminating overhead and latency caused by the TCP/IP stack.
By my estimations, this should be the most efficient way to run a web server behind Cloudflare, and should be a boon for both server performance and security.
I doubt that any other competing solutions are doing this, and probably wouldn't for some time (if ever). This could be a real differentiator for WPCD!
--
*Nginx, at least, can be configured to serve to a unix socket instead of a port with syntax like
listen unix:/tmp/site-name.sock;
. I'm not sure about OLS.*The syntax for connecting a Cloudflare Tunnel to a unix socket can be found here.
The text was updated successfully, but these errors were encountered: