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,9 +48,32 @@ 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
52
+
you could expose it at `http://your.domain`, so that the Internet users of
53
+
today may access it too without them having to know about any of this. It's
54
+
actually surpisingly simple to do, all you need for this is your previously
55
+
created TXT record and to point the A record of `your.domain` to the IP
56
+
address of an ipfs daemon that listens on port 80 for HTTP requests (such as
57
+
`gateway.ipfs.io`). The users' browsers will send `your.domain` in the Host
58
+
header of the requests, and you have your dnslink TXT records, so the ipfs
59
+
gateway will recognize `your.domain` as an IPNS name, and so it will serve
60
+
from under `/ipns/your.domain/` instead of `/`.
52
61
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`.
62
+
So, if you point `your.domain`'s A record to the IP of `gateway.ipfs.io`, and
63
+
then wait for the DNS to propogate, then anyone should be able to access your
64
+
ipfs-hosted site without any extra configuration simply at
65
+
`http://your.domain`.
66
+
67
+
Alternatively, it is possible to use CNAME records to point at the DNS records
68
+
of the gateway. This way, IP addresses of the gateway are automtically
69
+
updated. Note however that CNAME records to not allow for other records, such
70
+
as a TXT to refer to the ipfs/ipns record. Because of this, ipfs allows to
71
+
create a DNS TXT record for `_dnslink.your.domain` with
72
+
`dnslink=/ipns/<yourpeer id>`.
73
+
74
+
So by creating a CNAME for `your.domain` to `gateway.ipfs.io` and adding a
75
+
`_dnslink.your.domain` record with `dnslink=/ipns/<your peer id>` you can host
76
+
your website without explicitly referring to IP addresses of the ipfs gateway.
0 commit comments