Closed Jorropo closed 5 years ago
We actually do exactly this. This is how we, e.g., serve our own websites.
The only tricky part is HTTPS. If someone wants to use our gateways for https://yourdomain.com
, we'd need an SSL cert. We could create them on the fly with Let's Encrypt but we'd likely run into rate-limiting issues (and potentially ToS issues).
oh, ok :)
@Stebalien sorry for the delay but can you link me a doc to do this pls ?
Unfortunately, the best documentation on this isn't ours: https://developers.cloudflare.com/distributed-web/ipfs-gateway/connecting-website/
Fortunately, it's quite good.
@Stebalien ok thx, all have been said, I'm closing.
Today sharing a "website" in IPFS is easy and possible, but you have a very bad point. Ipfs link are ugly, even dnslink, (dnslink is super but this look strange). So I got an idea. Create seems less ipfs website. So you access :
But in real is A and/or AAAA resolve through a CNAME to idealy
gateway.example.com
or for low costrandomPublicIPFSGateway.org
. So the ipfs gateway receive the http request. It compare the host header with a list of associated, this list contain a list of all domain where the gateway is present, so if the domain is finded in this list serve regular public gateway, else continue here. (This list can be edited in the configuration file). Then the ipfs gateway do a dnslink on the received domain. (so here example.com) If finded return the corresponding ipfs resource :as
What potential problems of this ? (if you see one not pointed here, tell me, it will be added (with mention evidently))
x-ipfs-*
headers in the response of the server, also the first request make you get the first file so verify it with a dnslink resolved by your node and only download next file through your node. May also add this file to your node cache (not as regular upload) to serve it like you downloaded it.