Skip to content

Commit

Permalink
proxy: fix [warn] the "listen ... http2" directive is deprecated, use…
Browse files Browse the repository at this point in the history
… the "http2" directive instead
  • Loading branch information
baabeetaa committed Jul 10, 2024
1 parent 640ec03 commit 07d74cd
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 26 deletions.
14 changes: 9 additions & 5 deletions notionalapi/proxy/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ http {
# RPC-xapikey
server {
listen 80;
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name ~^r-(?<chain_name>.+)--(?<xapikey>.+)\.gw\.notionalapi\.net$;

proxy_hide_header 'Access-Control-Allow-Origin';
Expand Down Expand Up @@ -157,7 +158,8 @@ http {
# REST/API-xapikey
server {
listen 80;
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name ~^a-(?<chain_name>.+)--(?<xapikey>.+)\.gw\.notionalapi\.net$;

proxy_hide_header 'Access-Control-Allow-Origin';
Expand Down Expand Up @@ -191,8 +193,9 @@ http {

# gRPC-xapikey
server {
listen 9090 http2;
listen 443 ssl http2;
listen 9090;
listen 443 ssl;
http2 on;
server_name ~^g-(?<chain_name>.+)--(?<xapikey>.+)\.gw\.notionalapi\.net$;

location / {
Expand All @@ -205,7 +208,8 @@ http {
# JSON-RPC-xapikey
server {
listen 80;
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name ~^j-(?<chain_name>.+)--(?<xapikey>.+)\.gw\.notionalapi\.net$;

proxy_hide_header 'Access-Control-Allow-Origin';
Expand Down
3 changes: 2 additions & 1 deletion proxy/internal/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ http {
# grpc_ssl_server_name off;

server {
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name default.internalendpoints.$USE_DOMAIN_NAME;

location / {
Expand Down
28 changes: 18 additions & 10 deletions proxy/internal/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ for service_name in $SERVICES; do
# RPC
server {
listen 80;
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name rpc-${service_with_token}-ie.internalendpoints.$USE_DOMAIN_NAME;
$HEADER_CORS
location ~* ^/(.*) {
Expand All @@ -95,7 +96,8 @@ EOT
# REST/API
server {
listen 80;
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name api-${service_with_token}-ie.internalendpoints.$USE_DOMAIN_NAME;
$HEADER_CORS
location ~* ^/(.*) {
Expand All @@ -112,8 +114,9 @@ EOT
cat <<EOT >> /etc/nginx/endpoints.conf
# gRPC
server {
listen 9090 http2;
listen 443 ssl http2;
listen 9090;
listen 443 ssl;
http2 on;
server_name grpc-${service_with_token}-ie.internalendpoints.$USE_DOMAIN_NAME;
location / {
Expand All @@ -138,7 +141,8 @@ for service_name in $SERVICES_SUBNODE; do
# RPC
server {
listen 80;
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name rpc-${service_with_token}-sub.internalendpoints.$USE_DOMAIN_NAME;
$HEADER_CORS
location ~* ^/(.*) {
Expand All @@ -156,7 +160,8 @@ EOT
# REST/API
server {
listen 80;
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name api-${service_with_token}-sub.internalendpoints.$USE_DOMAIN_NAME;
$HEADER_CORS
location ~* ^/(.*) {
Expand All @@ -173,8 +178,9 @@ EOT
cat <<EOT >> /etc/nginx/endpoints.conf
# gRPC
server {
listen 9090 http2;
listen 443 ssl http2;
listen 9090;
listen 443 ssl;
http2 on;
server_name grpc-${service_with_token}-sub.internalendpoints.$USE_DOMAIN_NAME;
location / {
Expand All @@ -189,7 +195,8 @@ EOT
# JSON-RPC
server {
listen 80;
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name jsonrpc-${service_with_token}-sub.internalendpoints.$USE_DOMAIN_NAME;
$HEADER_CORS
Expand Down Expand Up @@ -232,7 +239,8 @@ for service_name in $SERVICES_JSONRPC; do
# JSON-RPC
server {
listen 80;
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name jsonrpc-${service_with_token}-ie.internalendpoints.$USE_DOMAIN_NAME;
$HEADER_CORS
Expand Down
28 changes: 18 additions & 10 deletions proxy/public/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ http {
# RPC
server {
listen 80;
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name ~^rpc-(?<chain_name>.+)-ia\.cosmosia\.notional\.ventures$;

proxy_hide_header 'Access-Control-Allow-Origin';
Expand Down Expand Up @@ -151,7 +152,8 @@ http {
# REST/API
server {
listen 80;
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name ~^api-(?<chain_name>.+)-ia\.cosmosia\.notional\.ventures$;

proxy_hide_header 'Access-Control-Allow-Origin';
Expand Down Expand Up @@ -184,8 +186,9 @@ http {

# gRPC
server {
listen 9090 http2;
listen 443 ssl http2;
listen 9090;
listen 443 ssl;
http2 on;
server_name ~^grpc-(?<chain_name>.+)-ia\.cosmosia\.notional\.ventures$;

location / {
Expand All @@ -197,7 +200,8 @@ http {
# JSON-RPC
server {
listen 80;
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name ~^jsonrpc-(?<chain_name>.+)-ia\.cosmosia\.notional\.ventures$;

proxy_hide_header 'Access-Control-Allow-Origin';
Expand Down Expand Up @@ -262,7 +266,8 @@ http {
# RPC
server {
listen 80;
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name ~^rpc-(?<chain_name>.+)-sub\.cosmosia\.notional\.ventures$;

proxy_hide_header 'Access-Control-Allow-Origin';
Expand Down Expand Up @@ -304,7 +309,8 @@ http {
# REST/API
server {
listen 80;
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name ~^api-(?<chain_name>.+)-sub\.cosmosia\.notional\.ventures$;

proxy_hide_header 'Access-Control-Allow-Origin';
Expand Down Expand Up @@ -337,8 +343,9 @@ http {

# gRPC
server {
listen 9090 http2;
listen 443 ssl http2;
listen 9090;
listen 443 ssl;
http2 on;
server_name ~^grpc-(?<chain_name>.+)-sub\.cosmosia\.notional\.ventures$;

location / {
Expand All @@ -350,7 +357,8 @@ http {
# JSON-RPC
server {
listen 80;
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name ~^jsonrpc-(?<chain_name>.+)-sub\.cosmosia\.notional\.ventures$;

proxy_hide_header 'Access-Control-Allow-Origin';
Expand Down

0 comments on commit 07d74cd

Please sign in to comment.