You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/config.md
+105
Original file line number
Diff line number
Diff line change
@@ -293,6 +293,7 @@ A boolean to configure whether the gateway is writeable or not.
293
293
294
294
Default: `false`
295
295
296
+
296
297
-`PathPrefixes`
297
298
Array of acceptable url paths that a client can specify in X-Ipfs-Path-Prefix header.
298
299
@@ -318,6 +319,110 @@ location /blog/ {
318
319
319
320
Default: `[]`
320
321
322
+
-`NoDNSLink`
323
+
A boolean to configure whether DNSLink lookup for value in `Host` HTTP header should be performed.
324
+
If DNSLink is present, content path stored in it is mounted at `/` and respective payload is returned to the client.
325
+
326
+
Default: `false`
327
+
328
+
### Gateway.PublicGateways
329
+
330
+
`PublicGateways` is a dictionary for overriding default options on specific fully qualified domain names (FQDN).
331
+
Options for changing behavior per hostname:
332
+
333
+
-`NoDNSLink`
334
+
Overrides global setting of the same name.
335
+
Default: `false`
336
+
-`PathPrefixes`
337
+
Array of paths that should be mounted at the root of domain name.
338
+
**TODO: this does not override global 'PathPrefixes' used for validation of X-Ipfs-Gateway-Prefix header. Should this have different name? eg. PathMounts?**
339
+
Example: `["/ipfs", "/ipns", "/api"]`
340
+
Default: `[]`
341
+
-**Note:** when both `PathPrefixes` and DNSLink are mounted, `PathPrefixes` take priority
342
+
-`UseSubdomains`
343
+
A boolean to configure whether the gateway provides [Origin isolation](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy)
344
+
between content roots.
345
+
Default: `false`
346
+
-`true` – mount [subdomain gateway](#https://docs-beta.ipfs.io/how-to/address-ipfs-on-web/#subdomain-gateway) at `http://{cid}.ipfs.{hostname}`
347
+
- requests for `http://{hostname}/ipfs/{cid}` will return redirect to `http://{cid}.ipfs.{hostname}`
348
+
-`false` – mount [path gateway](https://docs-beta.ipfs.io/how-to/address-ipfs-on-web/#path-gateway) at `http://{hostname}/ipfs/{cid}`
349
+
-**(not implemented yet)** due to the lack of Origin isolation, cookies and storage will be disabled by [Clear-Site-Data](https://github.com/ipfs/in-web-browsers/issues/157) header
350
+
351
+
352
+
#### Examples of common use cases
353
+
354
+
* Public [subdomain gateway](https://docs-beta.ipfs.io/how-to/address-ipfs-on-web/#subdomain-gateway) at `http://{cid}.ipfs.dweb.link`
355
+
```json
356
+
"Gateway": {
357
+
"PublicGateways": {
358
+
"dweb.link": {
359
+
"UseSubdomains": true
360
+
```
361
+
Version that redirects content paths
362
+
to subdomains (`http://dweb.link/ipfs/{cid}`→`http://{cid}.ipfs.dweb.link`) for backward-compatibility:
363
+
```json
364
+
"Gateway": {
365
+
"PublicGateways": {
366
+
"dweb.link": {
367
+
"UseSubdomains": true,
368
+
"PathPrefixes": ["/ipfs", "/ipns"]
369
+
```
370
+
**TODO: should this backward-compatibility redirect be enabled by the default when `UseSubdomains: true`?**
371
+
372
+
* Public [path gateway](https://docs-beta.ipfs.io/how-to/address-ipfs-on-web/#path-gateway) at `http://ipfs.io/ipfs/{cid}`
373
+
```json
374
+
"Gateway": {
375
+
"PublicGateways": {
376
+
"ipfs.io": {
377
+
"UseSubdomains": false,
378
+
"PathPrefixes": ["/ipfs", "/ipns", "/api"]
379
+
```
380
+
381
+
* Public [DNSLink](https://dnslink.io/) gateway (accepting every hostname passed in `Host` header)
0 commit comments