Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.