Skip to content

Instantly share code, notes, and snippets.

@strophy
Last active February 15, 2021 20:51
Show Gist options
  • Save strophy/db8aa126a04e10ff786ecc58afa8a067 to your computer and use it in GitHub Desktop.
Save strophy/db8aa126a04e10ff786ecc58afa8a067 to your computer and use it in GitHub Desktop.
dash platform nginx grpc config
server {
listen 3010 http2;
limit_req zone=protect_api burst=300 nodelay;
limit_req_status 429;
location = /org.dash.platform.dapi.v0.Core/subscribeToTransactionsWithProofs {
grpc_pass grpc://127.0.0.1:3006;
grpc_buffer_size 128k;
}
location ~ ^/org\.dash\.platform\.dapi\.v0\.Core {
grpc_pass grpc://127.0.0.1:3005;
grpc_buffer_size 128k;
}
location ~ ^/org\.dash\.platform\.dapi\.v0\.Platform {
grpc_pass grpc://127.0.0.1:3005;
grpc_buffer_size 128k;
}
location /grpc.health.v1.Health {
grpc_pass grpc://127.0.0.1:3006;
}
location ~ ^/org\.dash\.platform\.dapi\.v[0-9]+\.Core {
add_header content-type application/grpc;
add_header grpc-status 12;
add_header grpc-message "Specified service version is not supported";
return 204;
}
location ~ ^/org\.dash\.platform\.dapi\.v[0-9]+\.Platform {
add_header content-type application/grpc;
add_header grpc-status 12;
add_header grpc-message "Specified service version is not supported";
return 204;
}
# Error responses
include /etc/nginx/conf.d/errors.grpc_conf; # gRPC-compliant error responses
default_type application/grpc; # Ensure gRPC for all error responses
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment