Skip to content

Commit

Permalink
Merge pull request #6826 from ipfs/define-gateway-pathprefixes
Browse files Browse the repository at this point in the history
docs: define Gateway.PathPrefixes
  • Loading branch information
Stebalien authored Jan 15, 2020
2 parents 8a16b87 + 0eba53b commit 432bfc5
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 432bfc5

Please sign in to comment.