-
Notifications
You must be signed in to change notification settings - Fork 40
Make /ipfs and /ipns work with self-hosted ipfs.io #72
Conversation
@@ -76,9 +76,15 @@ server { | |||
|
|||
resolver 8.8.8.8 8.8.4.4; | |||
|
|||
set $hosturi $host$uri; | |||
set $proxyhost ""; | |||
if ($hosturi !~ "^dogfeed\.ipfs\.io/(ipfs|ipns)(/|$)") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need (dogfeed\.)?
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(or is this just for dogfeed?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes that's just for dogfeed.
LGTM. @lgierth assign to me if you want me to merge it, etc. |
If the host is ipfs.io, and the request is for /ipfs, /ipns, or /api, we don't pass the Host header on to the gateway, so that IPNSHostnameOption doesn't trigger, and the /ipfs and /ipns request can succeed. For all other requests with a Host header and TXT record, /ipfs, /ipns, and /api are not present. License: MIT Signed-off-by: Lars Gierth <[email protected]>
License: MIT Signed-off-by: Lars Gierth <[email protected]>
387fbc2
to
f51ed06
Compare
I just updated this to also make From my point of view it looks good:
ipfs/kubo#1615 is related but not blocking migrating ipfs.io, since it's only about arbitrary pages. |
Note: open the /api links in a new tab, a referer which is not ipfs.io, gateway.ipfs.io, or localhost results in a 403. |
@lgierth this LGTM!! we should update the note at the bottom of the site and say that this website is hosted via ipfs :) |
License: MIT Signed-off-by: Lars Gierth <[email protected]>
81805d9
to
591f969
Compare
Make /ipfs and /ipns work with self-hosted ipfs.io
If the host is ipfs.io, and the request is for /ipfs or /ipns,
we don't pass the Host header on to the gateway,
so that IPNSHostnameOption doesn't trigger,
and the /ipfs and /ipns request can succeed.
For all other requests with a Host header and TXT record,
/ipfs and /ipns are not present.