Skip to content

Instantly share code, notes, and snippets.

@mburns
Last active July 5, 2021 23:42
Show Gist options
  • Save mburns/79090525372d222fbd0a2cd48934133d to your computer and use it in GitHub Desktop.
Save mburns/79090525372d222fbd0a2cd48934133d to your computer and use it in GitHub Desktop.
http {
upstream backend {
server 127.0.0.1:8080;
keepalive 64;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name *.ipfs.example.com *.ipns.example.com;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Range, Content-Range, X-Chunked-Output, X-Stream-Output' always;
add_header 'Access-Control-Expose-Headers' 'Content-Range, X-Chunked-Output, X-Stream-Output' always;
add_header X-IPFS-POP $hostname always;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto "https";
proxy_pass http://backend;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment