Last active
December 13, 2021 15:54
-
-
Save Saigesp/a49a1d8394509422f638a4ceaac3c552 to your computer and use it in GitHub Desktop.
Nginx proxy pass example to avoid CORS on development
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 8008; | |
server_name localhost; | |
add_header 'Access-Control-Allow-Origin' '$http_origin'; | |
add_header 'Access-Control-Allow-Credentials' 'true'; | |
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range'; | |
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH'; | |
location / { | |
proxy_pass http://localhost:8000/; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment