Skip to content

Instantly share code, notes, and snippets.

@takinbo
Created July 9, 2019 09:28
Show Gist options
  • Save takinbo/883a953492d7ed3082a5410e68672794 to your computer and use it in GitHub Desktop.
Save takinbo/883a953492d7ed3082a5410e68672794 to your computer and use it in GitHub Desktop.
sample nginx configuration for blockstream esplora
server {
listen 80;
server_name explorer.local;
location ~ ^/api(/?)(.*) {
proxy_pass http://127.0.0.1:4000/$2;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
port_in_redirect off;
proxy_connect_timeout 300;
}
location / {
proxy_pass http://127.0.0.1:6000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
port_in_redirect off;
proxy_connect_timeout 300;
}
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript application/javascript text/xml application/xml application/xml+rss text/javascript;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6].(?!.*SV1)";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment