https://github.com/cyb3r-jak3/cf-example-cors-application
Example for CORs on two sites using Cloudflare access
https://github.com/cyb3r-jak3/cf-example-cors-application
Last synced: 4 months ago
JSON representation
Example for CORs on two sites using Cloudflare access
- Host: GitHub
- URL: https://github.com/cyb3r-jak3/cf-example-cors-application
- Owner: Cyb3r-Jak3
- License: mit
- Created: 2023-12-13T02:05:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-06T01:23:51.000Z (7 months ago)
- Last Synced: 2025-01-16T13:56:57.937Z (6 months ago)
- Language: JavaScript
- Size: 56.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cloudflare CORS ACCESS
Example of how to use CORS with Cloudflare access to pass credentials to a backend.
Replace all `.community.cyberjake.xyz` with your domain.Need the following:
Cloudflare Policies:
- 
- ### Backend:
Cloudflare tunnel token with public hostnames as shown below.
Edit the cors settings in [backend/index.js](backend/index.js) to match your origin.
### Frontend:
Edit the `server_name` in [frontend/nginx.conf](frontend/nginx.conf) to match your domain.
### Running:
```bash
docker compose up --build
```Wait for the tunnel to connect and then visit `https:///` to see the frontend and watch the console for the response from the backend.
## Demo
View the demo at [https://frontend.community.cyberjake.xyz/](https://frontend.community.cyberjake.xyz/).
#### Demo Notes
- It does require to verify with an email address to access the site.
- I am able to see emails that sign up, so please don't use any sensitive information. You can use a temporary email service like [Temp Mail](https://temp-mail.org/) to get a temporary email address.