-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f25476d
commit 96f919a
Showing
4 changed files
with
165 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
|
||
server { | ||
listen 443 http2; | ||
listen [::]:443 http2; | ||
server_name cardchain.crowdcontrol.network; | ||
#ssl_certificate /etc/letsencrypt/live/cardchain.crowdcontrol.network/fullchain.pem; | ||
#ssl_certificate_key /etc/letsencrypt/live/cardchain.crowdcontrol.network/privkey.pem; | ||
|
||
# Improve HTTPS performance with session resumption | ||
ssl_session_cache shared:SSL:10m; | ||
ssl_session_timeout 10m; | ||
|
||
# Enable server-side protection against BEAST attacks | ||
ssl_protocols TLSv1.2; | ||
ssl_prefer_server_ciphers on; | ||
ssl_ciphers "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384"; | ||
|
||
# RFC-7919 recommended: https://wiki.mozilla.org/Security/Server_Side_TLS#ffdhe4096 | ||
ssl_dhparam /etc/nginx/ssl/dhparam-4096.pem; | ||
ssl_ecdh_curve secp521r1:secp384r1; | ||
|
||
# Aditional Security Headers | ||
# ref: https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security | ||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; | ||
|
||
# ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options | ||
add_header X-Frame-Options DENY always; | ||
|
||
# ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options | ||
add_header X-Content-Type-Options nosniff always; | ||
|
||
# ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection | ||
add_header X-Xss-Protection "1; mode=block" always; | ||
|
||
# Enable OCSP stapling | ||
# ref. http://blog.mozilla.org/security/2013/07/29/ocsp-stapling-in-firefox | ||
ssl_stapling on; | ||
ssl_stapling_verify on; | ||
ssl_trusted_certificate /etc/letsencrypt/live/cardchain.crowdcontrol.network/fullchain.pem; | ||
#resolver 1.1.1.1 1.0.0.1 [2606:4700:4700::1111] [2606:4700:4700::1001] valid=300s; # Cloudflare | ||
resolver 127.0.0.11; | ||
resolver_timeout 5s; | ||
|
||
location ~ ^/cosmos(/.*)?$ { | ||
# Not sending ACAO header because it is already being added by the upstream | ||
#add_header 'Access-Control-Allow-Origin' '*' always; | ||
add_header 'Access-Control-Allow-Credentials' 'true' always; | ||
add_header 'Access-Control-Allow-Headers' '*' always; | ||
add_header 'Access-Control-Allow-Methods' '*' always; | ||
add_header 'Access-Control-Max-Age' 1728000 always; | ||
|
||
if ($request_method = 'OPTIONS') { | ||
return 200; | ||
} | ||
|
||
proxy_redirect off; | ||
proxy_set_header host $host; | ||
proxy_set_header X-real-ip $remote_addr; | ||
proxy_set_header X-forward-for $proxy_add_x_forwarded_for; | ||
proxy_pass http://blockchain:1317$1$is_args$args; | ||
} | ||
|
||
location ~ ^/grpc(/.*)?$ { | ||
grpc_pass grpcs://blockchain:9090$1$is_args$args; | ||
} | ||
|
||
location ~ ^/grpc2(/.*)?$ { | ||
grpc_pass grpcs://blockchain:9091$1$is_args$args; | ||
} | ||
|
||
location ~ ^/tendermint(/.*)?$ { | ||
# Not sending ACAO header because it is already being added by the upstream | ||
#add_header 'Access-Control-Allow-Origin' '*' always; | ||
add_header 'Access-Control-Allow-Credentials' 'true' always; | ||
add_header 'Access-Control-Allow-Headers' '*' always; | ||
add_header 'Access-Control-Allow-Methods' '*' always; | ||
add_header 'Access-Control-Max-Age' 1728000 always; | ||
|
||
if ($request_method = 'OPTIONS') { | ||
return 200; | ||
} | ||
|
||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
proxy_redirect off; | ||
proxy_set_header host $host; | ||
proxy_set_header X-real-ip $remote_addr; | ||
proxy_set_header X-forward-for $proxy_add_x_forwarded_for; | ||
proxy_set_header X-forwarded-proto $scheme; | ||
proxy_intercept_errors on; | ||
proxy_pass http://blockchain:26657$1$is_args$args; | ||
} | ||
|
||
location ~ ^/faucet(/.*)?$ { | ||
# Not sending ACAO header because it is already being added by the upstream | ||
#add_header 'Access-Control-Allow-Origin' '*' always; | ||
add_header 'Access-Control-Allow-Credentials' 'true' always; | ||
add_header 'Access-Control-Allow-Methods' '*' always; | ||
add_header 'Access-Control-Allow-Headers' '*' always; | ||
add_header 'Access-Control-Max-Age' 1728000 always; | ||
|
||
if ($request_method = 'OPTIONS') { | ||
return 200; | ||
} | ||
|
||
proxy_redirect off; | ||
proxy_set_header host $host; | ||
proxy_set_header X-real-ip $remote_addr; | ||
proxy_set_header X-forward-for $proxy_add_x_forwarded_for; | ||
proxy_pass http://blockchain:4500$1$is_args$args; | ||
} | ||
|
||
location /files/ { | ||
add_header 'Access-Control-Allow-Origin' '*' always; | ||
add_header 'Access-Control-Allow-Credentials' 'true' always; | ||
add_header 'Access-Control-Allow-Methods' '*' always; | ||
add_header 'Access-Control-Allow-Headers' '*' always; | ||
add_header 'Access-Control-Max-Age' 1728000 always; | ||
|
||
root /; | ||
} | ||
|
||
location /goat/ { | ||
add_header 'Access-Control-Allow-Origin' '*' always; | ||
add_header 'Access-Control-Allow-Credentials' 'true' always; | ||
add_header 'Access-Control-Allow-Methods' '*' always; | ||
add_header 'Access-Control-Allow-Headers' '*' always; | ||
add_header 'Access-Control-Max-Age' 1728000 always; | ||
|
||
proxy_redirect off; | ||
proxy_set_header host $host; | ||
proxy_set_header X-real-ip $remote_addr; | ||
proxy_set_header X-forward-for $proxy_add_x_forwarded_for; | ||
proxy_pass http://goat:31337; | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,4 @@ services: | |
command: /bin/bash -c "exec nginx -g 'daemon off;'" | ||
depends_on: | ||
- blockchain | ||
- goat |
This file contains 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