Skip to content

Commit 639ab02

Browse files
author
Jeff Schroeder
authored
Merge pull request #57 from SEJeff/nginx-proxy-updates
Nginx proxy config cleanup
2 parents 7cdb44e + 4380147 commit 639ab02

File tree

3 files changed

+31
-13
lines changed

3 files changed

+31
-13
lines changed

doc/nginx-configs/blockdaemon-virt-server-config.conf

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,34 @@ server {
1616
try_files /nonexistent-used-for-try-testing @$http_upgrade;
1717
}
1818

19+
# These need to be manually edited to your specific config.
20+
set $upstream_host YOUR_SERVER;
21+
set $auth_token REPLACE_ME_WITH_YOUR_AUTH_TOKEN;
22+
1923
location @websocket {
2024
# Cheat a little to make sure we don't have a trailing slash on the
2125
# path or we get a 405 response (method not allowed)
22-
proxy_pass https://YOUR_SERVER-solana-01.bdnodes.net/$http_upgrade;
26+
proxy_pass https://$upstream_host/$http_upgrade;
2327
proxy_http_version 1.1;
2428
proxy_set_header Host $proxy_host;
2529
# websocket requirements
2630
proxy_set_header Upgrade $http_upgrade;
2731
proxy_set_header Connection "Upgrade";
2832
# Blockdaemon specific authentication requirement
29-
proxy_set_header Authorization "Bearer REPLACE_ME_WITH_YOUR_AUTH_TOKEN";
33+
proxy_set_header Authorization "Bearer $auth_token";
3034
proxy_redirect https://$proxy_host http://$server_name:$server_port;
3135
proxy_redirect https:// http://;
3236
}
3337

3438
location @ {
35-
proxy_pass https://YOUR_SERVER-solana-01.bdnodes.net$request_uri;
39+
# Example: companyname-solana-09.bdnodes.net
40+
proxy_pass https://$upstream_host$request_uri;
3641
proxy_http_version 1.1;
3742
proxy_set_header Host $proxy_host;
3843
# HTTP v.1.1 keepalive requirements
3944
proxy_set_header Connection "";
4045
# Blockdaemon specific authentication requirement
41-
proxy_set_header Authorization "Bearer REPLACE_ME_WITH_YOUR_AUTH_TOKEN";
46+
proxy_set_header Authorization "Bearer $auth_token";
4247
proxy_redirect https://$proxy_host http://$server_name:$server_port;
4348
proxy_redirect https:// http://;
4449
}
@@ -53,15 +58,18 @@ server {
5358
server {
5459
listen 7800;
5560

61+
set $upstream_host YOUR_SERVER;
62+
set $auth_token REPLACE_ME_WITH_YOUR_AUTH_TOKEN;
63+
5664
location / {
57-
proxy_pass https://YOUR_SERVER-solana-01.bdnodes.net/websocket;
65+
proxy_pass https://$upstream_host/websocket;
5866
proxy_http_version 1.1;
5967
proxy_set_header Host $proxy_host;
6068
# websocket requirements
6169
proxy_set_header Upgrade $http_upgrade;
6270
proxy_set_header Connection "Upgrade";
6371
# Blockdaemon specific authentication requirement
64-
proxy_set_header Authorization "Bearer REPLACE_ME_WITH_YOUR_AUTH_TOKEN";
72+
proxy_set_header Authorization "Bearer $auth_token";
6573
proxy_redirect https://$proxy_host http://$server_name:$server_port;
6674
proxy_redirect https:// http://;
6775
}

doc/nginx-configs/figment-virt-server-config.conf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
server {
1313
listen 7901;
1414

15+
set $auth_token REPLACE_ME_WITH_YOUR_AUTH_TOKEN;
16+
1517
location / {
1618
try_files /nonexistent-used-for-try-testing @$http_upgrade;
1719
}
@@ -24,7 +26,7 @@ server {
2426
proxy_set_header Upgrade $http_upgrade;
2527
proxy_set_header Connection "Upgrade";
2628
# Figment specific authentication requirement
27-
proxy_set_header Authorization REPLACE_ME_WITH_YOUR_AUTH_TOKEN;
29+
proxy_set_header Authorization "$auth_token";
2830
proxy_redirect https://$proxy_host http://$server_name:$server_port;
2931
proxy_redirect https:// http://;
3032
}
@@ -35,7 +37,7 @@ server {
3537
proxy_set_header Host $proxy_host;
3638
proxy_set_header Connection "";
3739
# Figment specific authentication requirement
38-
proxy_set_header Authorization REPLACE_ME_WITH_YOUR_AUTH_TOKEN;
40+
proxy_set_header Authorization "$auth_token";
3941
proxy_redirect https://$proxy_host http://$server_name:$server_port;
4042
proxy_redirect https:// http://;
4143
}

doc/nginx-configs/triton-one-virt-server-config.conf

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@
1212
server {
1313
listen 7902;
1414

15+
# e.g: companyname1.rpcpool.com
16+
set $upstream_host YOUR_SERVER;
17+
set $auth_token REPLACE_ME_WITH_YOUR_AUTH_TOKEN;
18+
1519
location / {
1620
try_files /nonexistent-used-for-try-testing @$http_upgrade;
1721
}
1822

1923
location @websocket {
2024
# With authentication
21-
proxy_pass https://YOUR_SERVER.rpcpool.com/REPLACE_ME_WITH_YOUR_AUTH_TOKEN$request_uri;
25+
proxy_pass https://$upstream_host/$auth_token$request_uri;
2226

2327
# Without authentication, i.e. IP allow listed
2428
#proxy_pass https://YOUR_SERVER.rpcpool.com$request_uri;
@@ -33,10 +37,10 @@ server {
3337

3438
location @ {
3539
# With authentication
36-
proxy_pass https://YOUR_SERVER.rpcpool.com/REPLACE_ME_WITH_YOUR_AUTH_TOKEN$request_uri;
40+
proxy_pass https://$upstream_host/$auth_token$request_uri;
3741

3842
# Without authentication, i.e. IP allow listed
39-
#proxy_pass https://YOUR_SERVER.rpcpool.com$request_uri;
43+
#proxy_pass https://$upstream_host$request_uri;
4044
proxy_http_version 1.1;
4145
proxy_set_header Host $proxy_host;
4246
proxy_set_header Connection "";
@@ -54,12 +58,16 @@ server {
5458
server {
5559
listen 7802;
5660

61+
# e.g: companyname1.rpcpool.com
62+
set $upstream_host YOUR_SERVER;
63+
set $auth_token REPLACE_ME_WITH_YOUR_AUTH_TOKEN;
64+
5765
location / {
5866
# With authentication
59-
proxy_pass https://YOUR_SERVER.rpcpool.com/REPLACE_ME_WITH_YOUR_AUTH_TOKEN;
67+
proxy_pass https://$upstream_host/$auth_token;
6068

6169
# Without authentication, i.e. IP allow listed
62-
#proxy_pass https://YOUR_SERVER.rpcpool.com;
70+
#proxy_pass https://$upstream_host;
6371
proxy_http_version 1.1;
6472
proxy_set_header Host $proxy_host;
6573
# websocket requirements

0 commit comments

Comments
 (0)