Skip to content

Cyb3r-Jak3/cf-example-cors-application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  • Cloudflare CORS policy
  • Cloudflare Access Application

Backend:

Cloudflare tunnel token with public hostnames as shown below. Cloudflare Tunnel Public Hostnames

Edit the cors settings in backend/index.js to match your origin.

Frontend:

Edit the server_name in frontend/nginx.conf to match your domain.

Running:

docker compose up --build

Wait for the tunnel to connect and then visit https://<your domain>/ to see the frontend and watch the console for the response from the backend.

Demo

View the demo at 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 to get a temporary email address.

About

Example for CORs on two sites using Cloudflare access

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published