Last active
July 5, 2020 12:58
-
-
Save alediaferia/ebc7ecadb88889e6665b32aec9951f46 to your computer and use it in GitHub Desktop.
The chisel proxy NGINX configuration
This file contains hidden or 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 { | |
# Italian public free dns taken from https://public-dns.info/nameserver/it.html | |
resolver 88.80.70.7; | |
listen $__PORT__$ default_server; | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' 'https://chisel.cloud'; | |
add_header 'Access-Control-Allow-Credentials' 'true'; | |
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-Chisel-Proxied-Url,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'; | |
add_header 'Access-Control-Max-Age' 1728000; | |
add_header 'Content-Type' 'text/plain charset=UTF-8'; | |
add_header 'Content-Length' 0; | |
return 204; | |
} | |
add_header 'Access-Control-Allow-Credentials' 'true'; | |
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-Chisel-Proxied-Url,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'; | |
proxy_redirect off; | |
proxy_set_header Host $proxy_host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_pass $http_x_chisel_proxied_url; | |
proxy_hide_header 'access-control-allow-origin'; | |
add_header 'access-control-allow-origin' 'https://chisel.cloud'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment