@@ -8,6 +8,10 @@ $(for h in $(lookup gateway_hosts); do
8
8
done)
9
9
}
10
10
11
+ upstream ws_bootstrap {
12
+ server 127.0.0.1:8081;
13
+ }
14
+
11
15
# TODO set proper port in Host headers,
12
16
# we're just working around libp2p/go-ws-transport#8 for now.
13
17
@@ -20,6 +24,11 @@ server {
20
24
21
25
include conf.d/gateway/denylist.conf;
22
26
27
+ add_header 'Access-Control-Allow-Origin' '*' always;
28
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
29
+ add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Range, Content-Range, X-Chunked-Output, X-Stream-Output' always;
30
+ add_header 'Access-Control-Expose-Headers' 'Content-Range, X-Chunked-Output, X-Stream-Output' always;
31
+
23
32
proxy_pass_header Server;
24
33
proxy_read_timeout 1800s ;
25
34
@@ -39,6 +48,11 @@ server {
39
48
40
49
include conf.d/gateway/denylist.conf;
41
50
51
+ add_header 'Access-Control-Allow-Origin' '*' always;
52
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
53
+ add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Range, Content-Range, X-Chunked-Output, X-Stream-Output' always;
54
+ add_header 'Access-Control-Expose-Headers' 'Content-Range, X-Chunked-Output, X-Stream-Output' always;
55
+
42
56
proxy_pass_header Server;
43
57
proxy_read_timeout 1800s ;
44
58
@@ -62,6 +76,11 @@ server {
62
76
63
77
include conf.d/gateway/denylist.conf;
64
78
79
+ add_header 'Access-Control-Allow-Origin' '*' always;
80
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
81
+ add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Range, Content-Range, X-Chunked-Output, X-Stream-Output' always;
82
+ add_header 'Access-Control-Expose-Headers' 'Content-Range, X-Chunked-Output, X-Stream-Output' always;
83
+
65
84
proxy_pass_header Server;
66
85
proxy_read_timeout 1800s ;
67
86
@@ -87,6 +106,11 @@ server {
87
106
# 31536000 seconds = 12 months, as advised by hstspreload.org
88
107
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
89
108
109
+ add_header 'Access-Control-Allow-Origin' '*' always;
110
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
111
+ add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Range, Content-Range, X-Chunked-Output, X-Stream-Output' always;
112
+ add_header 'Access-Control-Expose-Headers' 'Content-Range, X-Chunked-Output, X-Stream-Output' always;
113
+
90
114
include conf.d/gateway/denylist.conf;
91
115
92
116
proxy_pass_header Server;
@@ -114,6 +138,11 @@ server {
114
138
# 31536000 seconds = 12 months, as advised by hstspreload.org
115
139
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
116
140
141
+ add_header 'Access-Control-Allow-Origin' '*' always;
142
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
143
+ add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Range, Content-Range, X-Chunked-Output, X-Stream-Output' always;
144
+ add_header 'Access-Control-Expose-Headers' 'Content-Range, X-Chunked-Output, X-Stream-Output' always;
145
+
117
146
include conf.d/gateway/denylist.conf;
118
147
119
148
proxy_pass_header Server;
@@ -147,6 +176,152 @@ server {
147
176
}
148
177
}
149
178
179
+ server {
180
+ server_name $(var pages_bootstrap_hostname).bootstrap.libp2p.io;
181
+ access_log /var/log/nginx/access.log mtail;
182
+
183
+ listen 443 ssl;
184
+ listen [::]:443 ssl;
185
+ ssl_certificate /etc/nginx/certs/bootstrap.libp2p.io.crt;
186
+ ssl_certificate_key /etc/nginx/certs/bootstrap.libp2p.io.key;
187
+ ssl_dhparam /etc/nginx/certs/bootstrap.libp2p.io.dhparam.pem;
188
+ ssl_trusted_certificate /etc/nginx/certs/bootstrap.libp2p.io.trustchain.crt;
189
+
190
+ # HSTS (ngx_http_headers_module is required)
191
+ # 31536000 seconds = 12 months, as advised by hstspreload.org
192
+ add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
193
+
194
+ add_header 'Access-Control-Allow-Origin' '*' always;
195
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
196
+ add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Range, Content-Range, X-Chunked-Output, X-Stream-Output' always;
197
+ add_header 'Access-Control-Expose-Headers' 'Content-Range, X-Chunked-Output, X-Stream-Output' always;
198
+
199
+ location / {
200
+ proxy_set_header Host $(var pages_bootstrap_hostname).bootstrap.libp2p.io:443;
201
+ proxy_set_header Upgrade \$http_upgrade ;
202
+ proxy_set_header Connection \$http_connection ;
203
+ proxy_set_header Sec-WebSocket-Key \$http_sec_websocket_key ;
204
+ proxy_set_header Sec-WebSocket-Extensions \$http_sec_websocket_extensions ;
205
+ proxy_set_header Sec-WebSocket-Version \$http_sec_websocket_version ;
206
+ proxy_pass http://ws_bootstrap;
207
+ proxy_pass_header Server;
208
+ proxy_read_timeout 60s ;
209
+ }
210
+ }
211
+
212
+ server {
213
+ server_name *.preload.ipfs.io;
214
+ access_log /var/log/nginx/access.log mtail;
215
+
216
+ listen 443 ssl;
217
+ listen [::]:443 ssl;
218
+ ssl_certificate /etc/nginx/certs/preload.ipfs.io.crt;
219
+ ssl_certificate_key /etc/nginx/certs/preload.ipfs.io.key;
220
+ ssl_dhparam /etc/nginx/certs/preload.ipfs.io.dhparam.pem;
221
+ ssl_trusted_certificate /etc/nginx/certs/preload.ipfs.io.trustchain.crt;
222
+
223
+ # HSTS (ngx_http_headers_module is required)
224
+ # 31536000 seconds = 12 months, as advised by hstspreload.org
225
+ add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
226
+
227
+ add_header 'Access-Control-Allow-Origin' '*' always;
228
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
229
+ add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Range, Content-Range, X-Chunked-Output, X-Stream-Output' always;
230
+ add_header 'Access-Control-Expose-Headers' 'Content-Range, X-Chunked-Output, X-Stream-Output' always;
231
+
232
+ location /ipfs {
233
+ proxy_set_header Host \$host :443;
234
+ proxy_set_header X-Ipfs-Gateway-Prefix "" ;
235
+ proxy_pass http://gateway;
236
+ }
237
+
238
+ location /ipns {
239
+ proxy_set_header Host \$host :443;
240
+ proxy_set_header X-Ipfs-Gateway-Prefix "" ;
241
+ proxy_pass http://gateway;
242
+ }
243
+
244
+ location /api {
245
+ proxy_set_header Host \$host :443;
246
+ proxy_set_header X-Ipfs-Gateway-Prefix "" ;
247
+ proxy_pass http://gateway;
248
+ }
249
+
250
+ location / {
251
+ proxy_set_header Host \$host :80;
252
+ proxy_set_header Upgrade \$http_upgrade ;
253
+ proxy_set_header Connection \$http_connection ;
254
+ proxy_set_header Sec-WebSocket-Key \$http_sec_websocket_key ;
255
+ proxy_set_header Sec-WebSocket-Extensions \$http_sec_websocket_extensions ;
256
+ proxy_set_header Sec-WebSocket-Version \$http_sec_websocket_version ;
257
+ proxy_pass http://ws_bootstrap;
258
+ proxy_pass_header Server;
259
+ proxy_read_timeout 60s ;
260
+ }
261
+ }
262
+
263
+ server {
264
+ server_name js.ipfs.io;
265
+
266
+ listen 443 ssl;
267
+ listen [::]:443 ssl;
268
+ ssl_certificate /etc/nginx/certs/ipfs.io.crt;
269
+ ssl_certificate_key /etc/nginx/certs/ipfs.io.key;
270
+ ssl_dhparam /etc/nginx/certs/dhparam.pem;
271
+ ssl_trusted_certificate /etc/nginx/certs/ipfs.io.trustchain.crt;
272
+
273
+ # HSTS (ngx_http_headers_module is required)
274
+ # 31536000 seconds = 12 months, as advised by hstspreload.org
275
+ add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
276
+
277
+ add_header 'Access-Control-Allow-Origin' '*' always;
278
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
279
+ add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Range, Content-Range, X-Chunked-Output, X-Stream-Output' always;
280
+ add_header 'Access-Control-Expose-Headers' 'Content-Range, X-Chunked-Output, X-Stream-Output' always;
281
+
282
+ location / {
283
+ proxy_set_header Host \$host ;
284
+ # The gateway upstream is defined in the gateway.conf.
285
+ proxy_pass http://gateway;
286
+ proxy_pass_header Server;
287
+ proxy_read_timeout 60s ;
288
+ }
289
+
290
+ location ~ "^/(ipfs|ipns)(/|$)" {
291
+ proxy_set_header Host "" ;
292
+ proxy_set_header X-Ipfs-Gateway-Prefix "" ;
293
+ proxy_pass http://gateway;
294
+ }
295
+ }
296
+
297
+ server {
298
+ server_name *.i.ipfs.io;
299
+
300
+ listen 443 ssl;
301
+ listen [::]:443 ssl;
302
+ ssl_certificate /etc/nginx/certs/i.ipfs.io.crt;
303
+ ssl_certificate_key /etc/nginx/certs/i.ipfs.io.key;
304
+ ssl_dhparam /etc/nginx/certs/i.ipfs.io.dhparam.pem;
305
+ ssl_trusted_certificate /etc/nginx/certs/i.ipfs.io.trustchain.crt;
306
+
307
+ # HSTS (ngx_http_headers_module is required)
308
+ # 31536000 seconds = 12 months, as advised by hstspreload.org
309
+ add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
310
+
311
+ add_header 'Access-Control-Allow-Origin' '*' always;
312
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
313
+ add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Range, Content-Range, X-Chunked-Output, X-Stream-Output' always;
314
+ add_header 'Access-Control-Expose-Headers' 'Content-Range, X-Chunked-Output, X-Stream-Output' always;
315
+
316
+ location / {
317
+ proxy_set_header Host "" ;
318
+ # The gateway upstream is defined in the gateway.conf.
319
+ proxy_pass http://gateway;
320
+ proxy_pass_header Server;
321
+ proxy_read_timeout 60s ;
322
+ }
323
+ }
324
+
150
325
server {
151
326
server_name *.ipfs.dweb.link *.ipns.dweb.link;
152
327
access_log /var/log/nginx/access.log mtail;
@@ -156,6 +331,11 @@ server {
156
331
157
332
include conf.d/gateway/denylist.conf;
158
333
334
+ add_header 'Access-Control-Allow-Origin' '*' always;
335
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
336
+ add_header 'Access-Control-Allow-Headers' 'X-Requested-With, Range, Content-Range, X-Chunked-Output, X-Stream-Output' always;
337
+ add_header 'Access-Control-Expose-Headers' 'Content-Range, X-Chunked-Output, X-Stream-Output' always;
338
+
159
339
proxy_pass_header Server;
160
340
proxy_read_timeout 1800s ;
161
341
0 commit comments