How to create a private gateway?

How to build a create gateway, only point to our LAN node. What about the steps? Thanks.
likce Ipfs. IO can fetch data from nodes around the world;
A private gateway fetches data from any one of several private nodes.
Like three nodes
/ ip4/ / TCP / 4001/ ipfs/hash
/ ip4/ / TCP / 4001 / ipfs/hash
/ ip4/ / TCP / 4001 / ipfs/hash

Does this help?

1 Like
Does this help?

I did not see the public gateway section that created the private network. I want to access a file with a private web gateway instead of http://ip:8080 /ipfs/hash to access a single node, and if the node fails, you can’t access it, thanks.

If you want the HTTP gateway to listen on a different interface than localhost, you need to change the config after you initialize the IPFS repository and before you run the daemon.

$ ipfs init
initializing IPFS node at /tmp/tmp.osruMYLwM4
generating 2048-bit RSA keypair...done
peer identity: Qmd2A9qtRKHv7tzV2W2B8qPUY3N5jxoiUbC53FmNTwAmk8
to get started, enter:

        ipfs cat /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme

The output from ipfs init shows you where the repository is located. In my case, it’s /tmp/tmp.osruMYLwM4 but will probably be something like /home/myuser/.ipfs for you, unless you change IPFS_PATH.

Then use this directory and open up the config file, which contains which address the gateway will bind to.

$ cat /tmp/tmp.osruMYLwM4/config | jq .Addresses

  "Swarm": [
  "Announce": [],
  "NoAnnounce": [],
  "API": "/ip4/",
  "Gateway": "/ip4/"

Now, if your private address is, just change /ip4/ to /ip4/ and the gateway will only be available via that IP.

I mean not modify gateway to listen 。 The hash Can be accessed at any public network node.
I mean to create a type of connection like ,such as https://private/ipfs/hash just to access the nodes of the private network.
/ip4/ What rules are used to access the nodes of the world。
What rules does my private network connection configure access to the private network?

If you create a private network then your files cannot be accessed at any public network node. They will be available only to the members of your private network.

Removing the bootstrap nodes limits your ability to serve files across the network.

You can choose either one:

Share swarm key with all the expected recipietns of the data (They need to run the node though; and make sure they have removed all bootstrap nodes - or your data is evidently accessible by a public gateway as usual)


Use IPFS API to serve data as state to public peers (choose this path only if the audience for your data is so huge and non-tech)