hyphacoop / api.distributed.press

Home Page:https://distributed.press

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support X-Ipfs-Path headers for static hosting

fauno opened this issue · comments

IPFS Companion can redirect traditional HTTP requests to IPFS if the x-ipfs-path response header is provided.

Additionally, some browser vendors like Brave may display an Open using IPFS button on the address bar when this header is returned for the root document in the current tab.

source

I think this can be done statically on Nginx config with something like this:

server {
  add_header "X-Ipfs-Path" "/ipns/$ssl_server_name";
}

Done! I checked with IPFS companion and it's able to use DNSLinks anyway. I don't have Brave installed to check if it shows the button with DNSLink.

Too bad we can't use a meta http-equiv tag: ipfs/ipfs-companion#1013