Fast and globally-distributed reverse proxy built using Cloudflare Workers. It allows you to proxy requests from your domain to another backend server.
Before using this reverse proxy, ensure that you have the following:
- A Cloudflare account
- A registered domain with Cloudflare
- Basic knowledge of Cloudflare Workers and JavaScript
-
Configure Cloudflare Workers:
- Log in to your Cloudflare dashboard.
- Navigate to the "Workers" section.
- Create a new Worker script.
-
Modify Worker Script:
- Update the
targetHost
variable with the URL of your backend server. - Customize any additional configurations in the script according to your needs.
- Update the
-
Deploy the Worker:
- Save the script.
- Deploy the script to Cloudflare Workers.
-
Configure DNS:
- Ensure that your domain's DNS records are correctly configured to point to Cloudflare's nameservers.
- Verify that the Cloudflare proxy (orange cloud icon) is enabled for the DNS records associated with your domain.
-
Test the Reverse Proxy:
- Access your application by navigating to
https://yourdomain.com
. - The reverse proxy should forward requests to your backend server.
- Access your application by navigating to
- targetHost: The URL of the backend server you want to proxy requests to.
- Additional Configurations: Modify the script to add custom headers, authentication, or other proxy-related configurations.
Feel free to customize the reverse proxy script based on your requirements. You can add features, modify headers, or implement security measures according to your needs.
This project is licensed under the MIT License.
- Cloudflare Workers documentation: https://developers.cloudflare.com/workers/
If you encounter issues or have suggestions for improvements, feel free to open an issue or submit a pull request.