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
A boolean to configure whether the gateway at the hostname provides [Origin isolation](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy)
447
+
between content roots.
448
+
449
+
- `true` - enable [subdomain gateway](#https://docs-beta.ipfs.io/how-to/address-ipfs-on-web/#subdomain-gateway) at `http://*.{hostname}/`
450
+
- **Note 1:** make sure respective `Paths` are set.
451
+
For example, `Paths: ["/ipfs", "/ipns"]` are required for `http://{cid}.ipfs.{hostname}` and `http://{foo}.ipns.{hostname}` to work:
452
+
```json
453
+
{
454
+
"Gateway": {
455
+
"PublicGateways": {
456
+
"dweb.link": {
457
+
"UseSubdomains": true,
458
+
"Paths": ["/ipfs", "/ipns"],
459
+
```
460
+
- **Note 2:** Requests for content paths such as `http://{hostname}/ipfs/{cid}` produce redirect to `http://{cid}.ipfs.{hostname}`
461
+
462
+
- `false` - enable [path gateway](https://docs-beta.ipfs.io/how-to/address-ipfs-on-web/#path-gateway) at `http://{hostname}/*`
463
+
- Example:
464
+
```json
465
+
{
466
+
"Gateway": {
467
+
"PublicGateways": {
468
+
"ipfs.io": {
469
+
"UseSubdomains": false,
470
+
"Paths": ["/ipfs", "/ipns", "/api"],
471
+
```
472
+
<!-- **(not implemented yet)** due to the lack of Origin isolation, cookies and storage on `Paths` will be disabled by [Clear-Site-Data](https://github.com/ipfs/in-web-browsers/issues/157) header -->
416
473
417
474
Default: `false`
418
475
419
-
### Gateway.PublicGateways
420
476
421
-
`PublicGateways` is a dictionary for defining gateway behavior on specific fully qualified domain names (FQDN).
A boolean to configure whether DNSLink for hostname present in `Host`
480
+
HTTP header should be resolved. Overrides global setting.
481
+
If `Paths` are defined, they take priority over DNSLink.
423
482
424
-
-`Paths`
425
-
Array of paths that should be mounted at the root of domain name.
426
-
Example: `["/ipfs", "/ipns", "/api"]`
427
-
**Note:** If DNSLink is enabled, all defined `Paths` are mounted on top of `/` and take priority over DNSLink.
483
+
Default: `false` (DNSLink lookup enabled by default for every defined hostname)
428
484
429
-
-`UseSubdomains`
430
-
A boolean to configure whether the gateway provides [Origin isolation](https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy)
431
-
between content roots.
432
-
Default: `false`
433
-
-`true` – mount [subdomain gateway](#https://docs-beta.ipfs.io/how-to/address-ipfs-on-web/#subdomain-gateway) at `http://*.{hostname}`
434
-
- requires respective `Paths` to be set
435
-
Example: `Paths: ["/ipfs", "/ipns"]` is required for `http://{cid}.ipfs.{hostname}` and `http://{foo}.ipns.{hostname}` to work.
436
-
- requests for content paths such as `http://{hostname}/ipfs/{cid}` will return redirect to `http://{cid}.ipfs.{hostname}`
437
-
-`false` – mount [path gateway](https://docs-beta.ipfs.io/how-to/address-ipfs-on-web/#path-gateway) at `http://{hostname}/ipfs/{cid}`
438
-
<!-- **(not implemented yet)** due to the lack of Origin isolation, cookies and storage on `Paths` will be disabled by [Clear-Site-Data](https://github.com/ipfs/in-web-browsers/issues/157) header -->
485
+
#### Implicit defaults of `Gateway.PublicGateways`
439
486
440
-
-`NoDNSLink`
441
-
A boolean to configure whether DNSLink for FQDN present in `Host`
442
-
HTTP header should be resolved. Overrides global setting.
443
-
Default: `false` (DNSLink enabled by default for every defined hostname)
487
+
Default entries for `localhost` hostname and loopback IPs are always present.
488
+
If additional config is provided for those hostnames, it will be merged on top of implicit values:
489
+
```json
490
+
{
491
+
"Gateway": {
492
+
"PublicGateways": {
493
+
"127.0.0.1": {
494
+
"Paths": ["/ipfs", "/ipns", "/api"],
495
+
"UseSubdomains": false
496
+
},
497
+
"::1": {
498
+
"Paths": ["/ipfs", "/ipns", "/api"],
499
+
"UseSubdomains": false
500
+
},
501
+
"localhost": {
502
+
"Paths": ["/ipfs", "ipns"],
503
+
"UseSubdomains": true
504
+
}
505
+
}
506
+
}
507
+
}
508
+
```
444
509
445
-
#### Examples of common use cases
510
+
### `Gateway` recipes
446
511
447
-
* Public [subdomain gateway](https://docs-beta.ipfs.io/how-to/address-ipfs-on-web/#subdomain-gateway) at `http://{cid}.ipfs.dweb.link`
512
+
* Public [subdomain gateway](https://docs-beta.ipfs.io/how-to/address-ipfs-on-web/#subdomain-gateway) at `http://{cid}.ipfs.dweb.link` (each content root gets its own Origin)
448
513
```json
449
514
"Gateway": {
450
515
"PublicGateways": {
@@ -455,7 +520,7 @@ Options for changing behavior per hostname:
455
520
**Note:** this enables automatic redirects from content paths to subdomains
0 commit comments