Skip to content

Download Links Redirect to 127.0.0.1 When Using a Public Gateway with Reverse Proxy #2383

@arisumimi

Description

@arisumimi

Describe the bug
A clear and concise description of what the bug is.

When configuring Kubo to serve a public gateway behind a reverse proxy (tested with Nginx and Caddy), the download links generated by the WebUI and the gateway continue to redirect to http://127.0.0.1:8080/... instead of using the public domain.

This completely breaks the ability for external users to download files via WebUI or direct links.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'a file on the webui'
  2. Click on 'the download button'
  3. See error

Expected behavior
When using Kubo behind a reverse proxy (such as Nginx or Caddy) with a properly configured public gateway, all generated URLs including download links and redirects from the WebUI or API should consistently use the public domain (e.g., https://ipfs.alicepantsu.moe) instead of the local address (http://127.0.0.1:8080).

Specifically:

The Location header in HTTP responses should point to the public gateway domain.

The WebUI should generate download links that respect the public proxy address, making them accessible to external users.

No hardcoded redirects to 127.0.0.1 should occur when accessing files or clicking the "download" button.

This would allow seamless external access to IPFS content via the public gateway without manual header rewriting or fragile reverse proxy tricks.

Desktop (please complete the following information):

  • OS: Windows
  • Browser Chrome
  • Version 137.0.7151.120

Additional context

Gateway Configuration Used:

"PublicGateways": {
"ipfs.alicepantsu.moe": {
"NoDNSLink": false,
"Paths": ["/ipfs", "/ipns"],
"UseSubdomains": false
}
},
"HTTPHeaders": {
"Access-Control-Allow-Origin": [
"https://ipfs.alicepantsu.moe",
"http://localhost:3000",
"http://127.0.0.1:5001",
"https://webui.ipfs.io"
],
"Access-Control-Allow-Methods": ["PUT", "POST"]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    need/triageNeeds initial labeling and prioritization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions