mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-25 04:17:44 +08:00
docs: define Gateway.PathPrefixes
adds docs for Gateway.PathPrefixes. Taken from great commit notes by @lgierth (thank you!) 09937f84b6
This commit is contained in:
parent
8a16b8704b
commit
0eba53bd98
@ -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: `[]`
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user