-
Notifications
You must be signed in to change notification settings - Fork 145
/
nginx.conf
168 lines (151 loc) · 19.9 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_static on;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_proxied any;
gzip_vary on;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
server {
listen 80;
root /usr/share/nginx/html;
index index.html index.htm;
# Redirect `http` to `https`
if ($http_x_forwarded_proto = "http") {
return 301 https://$host$request_uri;
}
# Normalize URLs
merge_slashes off; # required for the next two rules to see the adjacent slashes
rewrite ^//+(.*) $scheme://$http_host/$1 permanent; # remove adjacent slashes at the start of the URI
rewrite ^/(.*)//+(.*) $scheme://$http_host/$1/$2 permanent; # remove adjacent slashes in the middle of the URI
rewrite ^/([^.]*[^/])$ $scheme://$http_host/$1/ permanent; # force a trailing slash except for files with an extension
# Redirect to `/en` if no language in URL and not an asset URL
rewrite ^/docs/(?!(?:[a-zA-Z][a-zA-Z]|_next|img)(?:/|$))(.*)$ $scheme://$http_host/docs/en/$1 permanent;
# Permanent redirects (301)
rewrite ^/docs/([a-zA-Z][a-zA-Z])/about/introduction/$ $scheme://$http_host/docs/$1/about/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/arbitrum-faq/$ $scheme://$http_host/docs/$1/archived/arbitrum/arbitrum-faq/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/arbitrum/l2-transfer-tools-faq/$ $scheme://$http_host/docs/$1/archived/arbitrum/l2-transfer-tools-faq/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/arbitrum/l2-transfer-tools-guide/$ $scheme://$http_host/docs/$1/archived/arbitrum/l2-transfer-tools-guide/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/billing/$ $scheme://$http_host/docs/$1/subgraphs/billing/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/chain-integration-overview/$ $scheme://$http_host/docs/$1/indexing/chain-integration-overview/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/arweave/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/arweave/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/avoid-eth-calls/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/avoid-eth-calls/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/cosmos/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/cosmos/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/derivedfrom/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/derivedfrom/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/enums/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/enums/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/grafting-hotfix/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/grafting-hotfix/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/grafting/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/grafting/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/immutable-entities-bytes-as-ids/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/immutable-entities-bytes-as-ids/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/near/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/near/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/pruning/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/pruning/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/quick-start/$ $scheme://$http_host/docs/$1/subgraphs/quick-start/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/subgraph-debug-forking/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/subgraph-debug-forking/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/subgraph-uncrashable/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/subgraph-uncrashable/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/substreams-powered-subgraphs/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/substreams-powered-subgraphs/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/timeseries/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/timeseries/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/transfer-to-the-graph/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/transfer-to-the-graph/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/curating/$ $scheme://$http_host/docs/$1/resources/roles/curating/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/delegating/$ $scheme://$http_host/docs/$1/resources/roles/delegating/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/deploying/deploy-using-subgraph-studio/$ $scheme://$http_host/docs/$1/subgraphs/developing/deploying/using-subgraph-studio/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/deploying/deploying-a-subgraph-to-studio/$ $scheme://$http_host/docs/$1/subgraphs/developing/deploying/using-subgraph-studio/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/deploying/multiple-networks/$ $scheme://$http_host/docs/$1/subgraphs/developing/deploying/multiple-networks/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/deploying/subgraph-studio-faqs/$ $scheme://$http_host/docs/$1/subgraphs/developing/deploying/subgraph-studio-faq/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/deploying/subgraph-studio/$ $scheme://$http_host/docs/$1/subgraphs/developing/deploying/using-subgraph-studio/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/assemblyscript-api/$ $scheme://$http_host/docs/$1/subgraphs/developing/creating/graph-ts/api/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/creating-a-subgraph/$ $scheme://$http_host/docs/$1/subgraphs/developing/creating/starting-your-subgraph/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/creating-a-subgraph/starting-your-subgraph/$ $scheme://$http_host/docs/$1/subgraphs/developing/creating/starting-your-subgraph/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/creating-a-subgraph/install-the-cli/$ $scheme://$http_host/docs/$1/subgraphs/developing/creating/install-the-cli/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/creating-a-subgraph/ql-schema/$ $scheme://$http_host/docs/$1/subgraphs/developing/creating/ql-schema/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/creating-a-subgraph/assemblyscript-mappings/$ $scheme://$http_host/docs/$1/subgraphs/developing/creating/assemblyscript-mappings/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/creating-a-subgraph/advanced/$ $scheme://$http_host/docs/$1/subgraphs/developing/creating/advanced/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/defining-a-subgraph/$ $scheme://$http_host/docs/$1/subgraphs/developing/creating/starting-your-subgraph/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/developer-faqs/$ $scheme://$http_host/docs/$1/subgraphs/developing/developer-faq/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/graph-ts/api/$ $scheme://$http_host/docs/$1/subgraphs/developing/creating/graph-ts/api/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/graph-ts/CHANGELOG/$ $scheme://$http_host/docs/$1/subgraphs/developing/creating/graph-ts/CHANGELOG/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/graph-ts/common-issues/$ $scheme://$http_host/docs/$1/subgraphs/developing/creating/graph-ts/common-issues/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/graph-ts/README/$ $scheme://$http_host/docs/$1/subgraphs/developing/creating/graph-ts/README/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/substreams-powered-subgraphs-faq/$ $scheme://$http_host/docs/$1/substreams/sps/sps-faq/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/supported-networks/$ $scheme://$http_host/docs/$1/supported-networks/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/developing/unit-testing-framework/$ $scheme://$http_host/docs/$1/subgraphs/developing/creating/unit-testing-framework/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/explorer/$ $scheme://$http_host/docs/$1/subgraphs/explorer/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/firehose/$ $scheme://$http_host/docs/$1/indexing/tooling/firehose/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/glossary/$ $scheme://$http_host/docs/$1/resources/glossary/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/graphcast/$ $scheme://$http_host/docs/$1/indexing/tooling/graphcast/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/indexing/$ $scheme://$http_host/docs/$1/indexing/overview/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/managing/delete-a-subgraph/$ $scheme://$http_host/docs/$1/subgraphs/developing/managing/deleting-a-subgraph/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/managing/deprecate-a-subgraph/$ $scheme://$http_host/docs/$1/subgraphs/developing/managing/deleting-a-subgraph/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/managing/transfer-a-subgraph/$ $scheme://$http_host/docs/$1/subgraphs/developing/managing/transferring-a-subgraph/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/network-transition-faq/$ $scheme://$http_host/docs/$1/archived/arbitrum/arbitrum-faq/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/network/benefits/$ $scheme://$http_host/docs/$1/resources/benefits/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/network/contracts/$ $scheme://$http_host/docs/$1/contracts/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/network/curating/$ $scheme://$http_host/docs/$1/resources/roles/curating/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/network/delegating/$ $scheme://$http_host/docs/$1/resources/roles/delegating/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/network/developing/$ $scheme://$http_host/docs/$1/subgraphs/developing/introduction/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/network/explorer/$ $scheme://$http_host/docs/$1/subgraphs/explorer/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/network/indexing/$ $scheme://$http_host/docs/$1/indexing/overview/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/new-chain-integration/$ $scheme://$http_host/docs/$1/indexing/new-chain-integration/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/operating-graph-node/$ $scheme://$http_host/docs/$1/indexing/tooling/graph-node/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/publishing/publishing-a-subgraph/$ $scheme://$http_host/docs/$1/subgraphs/developing/publishing/publishing-a-subgraph/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/querying/distributed-systems/$ $scheme://$http_host/docs/$1/subgraphs/querying/distributed-systems/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/querying/graph-client/README/$ $scheme://$http_host/docs/$1/subgraphs/querying/graph-client/README/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/querying/graph-client/architecture/$ $scheme://$http_host/docs/$1/subgraphs/querying/graph-client/architecture/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/querying/graph-client/live/$ $scheme://$http_host/docs/$1/subgraphs/querying/graph-client/live/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/querying/graphql-api/$ $scheme://$http_host/docs/$1/subgraphs/querying/graphql-api/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/querying/managing-api-keys/$ $scheme://$http_host/docs/$1/subgraphs/querying/managing-api-keys/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/querying/querying-best-practices/$ $scheme://$http_host/docs/$1/subgraphs/querying/best-practices/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/querying/querying-by-subgraph-id-vs-deployment-id/$ $scheme://$http_host/docs/$1/subgraphs/querying/subgraph-id-vs-deployment-id/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/querying/querying-from-an-application/$ $scheme://$http_host/docs/$1/subgraphs/querying/from-an-application/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/querying/querying-the-graph/$ $scheme://$http_host/docs/$1/subgraphs/querying/introduction/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/querying/querying-with-python/$ $scheme://$http_host/docs/$1/subgraphs/querying/python/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/quick-start/$ $scheme://$http_host/docs/$1/subgraphs/quick-start/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/release-notes/assemblyscript-migration-guide/$ $scheme://$http_host/docs/$1/resources/release-notes/assemblyscript-migration-guide/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/release-notes/graphql-validations-migration-guide/$ $scheme://$http_host/docs/$1/resources/release-notes/graphql-validations-migration-guide/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/sps/introduction/$ $scheme://$http_host/docs/$1/substreams/sps/introduction/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/sps/triggers-example/$ $scheme://$http_host/docs/$1/substreams/sps/tutorial/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/sps/triggers/$ $scheme://$http_host/docs/$1/substreams/sps/triggers/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/billing/$ $scheme://$http_host/docs/$1/subgraphs/billing/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/deploy-subgraph-studio/$ $scheme://$http_host/docs/$1/subgraphs/developing/deploying/using-subgraph-studio/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/managing-api-keys/$ $scheme://$http_host/docs/$1/subgraphs/querying/managing-api-keys/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/multisig/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/multisig/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/studio-faq/$ $scheme://$http_host/docs/$1/subgraphs/developing/deploying/subgraph-studio-faq/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/subgraph-studio/$ $scheme://$http_host/docs/$1/subgraphs/developing/deploying/using-subgraph-studio/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/transferring-subgraph-ownership/$ $scheme://$http_host/docs/$1/subgraphs/developing/managing/transferring-a-subgraph/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/subgraphs/$ $scheme://$http_host/docs/$1/subgraphs/developing/subgraphs/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/substreams/$ $scheme://$http_host/docs/$1/substreams/introduction/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/sunrise/$ $scheme://$http_host/docs/$1/archived/sunrise/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/supported-network-requirements/$ $scheme://$http_host/docs/$1/indexing/supported-network-requirements/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/supported-networks/arweave/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/arweave/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/supported-networks/cosmos/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/cosmos/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/supported-networks/near/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/near/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/tap/$ $scheme://$http_host/docs/$1/indexing/tap/ permanent;
rewrite ^/docs/([a-zA-Z][a-zA-Z])/tokenomics/$ $scheme://$http_host/docs/$1/resources/tokenomics/ permanent;
# Temporary redirects (302)
rewrite ^/docs/en/querying/graph-client/$ $scheme://$http_host/docs/en/subgraphs/querying/graph-client/README/ redirect;
rewrite ^/docs/en/developing/graph-ts/$ $scheme://$http_host/docs/en/subgraphs/developing/creating/graph-ts/README/ redirect;
location / {
try_files $uri $uri.html $uri/index.html =404;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
expires -1;
}
location ~ ^/docs/([a-zA-Z][a-zA-Z])/(.*) {
error_page 404 /docs/$1/404/index.html;
}
error_page 500 502 503 504 /docs/50x/index.html;
}
}
stream {}