Last active
April 4, 2024 13:15
-
-
Save wakiyamap/15122fc22fdc4fda01cc34439824f7a0 to your computer and use it in GitHub Desktop.
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
upstream websocket { | |
server localhost:9141; | |
} | |
server { | |
listen 443 ssl; | |
ssl on; | |
ssl_certificate /etc/nginx/certs/electrum-mona.org.pem; | |
ssl_certificate_key /etc/nginx/certs/electrum-mona.org.key; | |
ssl_client_certificate /etc/nginx/certs/cloudflare.crt; | |
ssl_verify_client on; | |
server_name blockbook.electrum-mona.org; | |
location / { | |
add_header Access-Control-Allow-Origin '*' always; | |
proxy_pass https://[::]:9141; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-NginX-Proxy true; | |
# Enables WS support | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_redirect off; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
については、cloudflare側で
TLS Authenticated Origin Pulls
設定をしていない限りは必要ないadd_header Access-Control-Allow-Origin '*' always;
はもにゃの為に追加している。proxy_pass https://[::]:9141;
IPv6サーバの場合、IPv6でListenしてる場合があるのでその場合はこれ。
大体は
localhost
で行けるとは思うがnetstat -an
等で確認すると良さげ