Skip to content

Commit

Permalink
docs: define Gateway.PathPrefixes
Browse files Browse the repository at this point in the history
adds docs for Gateway.PathPrefixes. Taken from great commit notes by @lgierth (thank you!) 09937f8
  • Loading branch information
olizilla authored Jan 15, 2020
1 parent 8a16b87 commit 0eba53b
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,27 @@ A boolean to configure whether the gateway is writeable or not.
Default: `false`

- `PathPrefixes`
TODO
Array of acceptable url paths that a client can specify in X-Ipfs-Path-Prefix header.

The X-Ipfs-Path-Prefix header is used to specify a base path to prepend to links in directory listings and for trailing-slash redirects. It is intended to be set by a frontend http proxy like nginx.

Example: We mount `blog.ipfs.io` (a dnslink page) at `ipfs.io/blog`.

**.ipfs/config**
```json
"Gateway": {
"PathPrefixes": ["/blog"],
```

**nginx_ipfs.conf**
```nginx
location /blog/ {
rewrite "^/blog(/.*)$" $1 break;
proxy_set_header Host blog.ipfs.io;
proxy_set_header X-Ipfs-Gateway-Prefix /blog;
proxy_pass http://127.0.0.1:8080;
}
```

Default: `[]`

Expand Down

0 comments on commit 0eba53b

Please sign in to comment.