You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 12, 2020. It is now read-only.
The very last hash next to the folder name is the one you want, lets call it
21
-
`$SITE_HASH` for now.
21
+
`$SITE_HASH` for now.
22
22
23
23
Now, you can test it out locally by opening `http://localhost:8080/ipfs/$SITE_HASH`
24
24
in your web browser! Next, to view it coming from another ipfs node, you can try
@@ -48,10 +48,20 @@ And also try the same link on the public gateway. Once you're convinced that wor
48
48
lets again hide the hash. Change your DNS TXT record to `dnslink=/ipns/<your peer id>`,
49
49
wait for that record to propogate, and then try accessing `http://localhost:8080/ipns/your.domain`.
50
50
51
-
At this point, you have a website on ipfs/ipns, and you may be wondering how you could expose it at `http://your.domain`, so that the Internet users of today may access it too without them having to know about any of this. It's actually surpisingly simple to do, all you need for this is your previously created TXT record and to point the A record of `your.domain` to the ip address of an ipfs daemon that listens on port 80 for HTTP requests (such as `gateway.ipfs.io`). The users' browsers will send `your.domain` in the Host header of the requests, and you have your dnslink TXT records, so the ipfs gateway will recognize `your.domain` as an IPNS name, and so it will serve from under `/ipns/your.domain/` instead of `/`.
51
+
At this point, you have a website on ipfs/ipns, and you may be wondering how you could expose it at `http://your.domain`, so that the Internet users of today may access it too without them having to know about any of this. It's actually surpisingly simple to do, all you need for this is your previously created TXT record and to point the A record of `your.domain` to the IP address of an ipfs daemon that listens on port 80 for HTTP requests (such as `gateway.ipfs.io`). The users' browsers will send `your.domain` in the Host header of the requests, and you have your dnslink TXT records, so the ipfs gateway will recognize `your.domain` as an IPNS name, and so it will serve from under `/ipns/your.domain/` instead of `/`.
52
52
53
53
So, if you point `your.domain`'s A record to the IP of `gateway.ipfs.io`, and then wait for the DNS to propogate, then anyone should be able to access your ipfs-hosted site without any extra configuration simply at `http://your.domain`.
54
54
55
+
Alternately, it is possible to use CNAME records to point at the DNS records of
56
+
the gateway. This way, IP addresses of the gateway are automtically
57
+
updated. Note however that CNAME records to not allow for other records, such as
58
+
a TXT to refer to the ipfs/ipns record. Because of this, ipfs allows to create
59
+
a DNS TXT record for `_dnslink.your.domain` with `dnslink=/ipns/<your peer id>`.
60
+
61
+
So by creating a CNAME for `your.domain` to `gateway.ipfs.io` and adding a
62
+
`_dnslink.your.domain` record with `dnslink=/ipns/<your peer id>` you can host
63
+
your website without explicitly referring to IP addresses of the ipfs gateway.
0 commit comments