IPFS Gateway returns 404 when using api/v0/add

Greetings,

I have recently set up a go-ipfs node for testing as a gateway. I have been able to add files locally on the server, and read them remotely in the browser, as well as in code (C#, .Net and the Ipfs.Http.Client library). However, trying to add a file from a remote machine, using http://mynode/api/v0/add fails with a 404 error.

I have set “Writeable”: true in the config file, and the daemon indicates that it is writeable on startup.

The request looks like this

POST /api/v0/add?chunker=size-262144 HTTP/1.1
User-Agent: net-ipfs/0.33
Accept-Encoding: gzip, deflate
Content-Type: multipart/form-data; boundary=“3ac6737d-2600-454f-ae91-9a5713b2c22b”
Content-Length: 227
Host: myrealhostaddress:8080

–3ac6737d-2600-454f-ae91-9a5713b2c22b
Content-Type: application/octet-stream
Content-Disposition: form-data; name=file; filename=unknown; filename*=utf-8’'unknown

This is a test
–3ac6737d-2600-454f-ae91-9a5713b2c22b–

Has anyone experienced this behavior, or does anyone have any ideas on how to begin diagnosing this problem?

Thanks,
Chris

not work… you need a proxy

Ok, I can see that now. Thank you very much.

hey, have a look to Writeable HTTP Gateways which describes the usage of the writable gateway endpoints.

The writable gateway endpoint is not the same as the HTTP API (API runs on 5001 and gateway on 8080). You are getting a 404 because the path you are posting to is not handled by the gateway (but it should be by the API).

Depending on your access-control requirements, you may need to setup a reverse proxy in-between to control authentication etc. or to limit the API surface area that is exposed.

1 Like