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.
I think this can be done statically on Nginx config with something like this:
server {
add_header "X-Ipfs-Path" "/ipns/$ssl_server_name";
}
If you want you could try doing a PR here: https://github.com/hyphacoop/api.distributed.press/blob/main/ansible/roles/distributed_press/templates/nginx-static.j2
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