Skip to content

502 Bad Gateway Error When Using HTTP Proxy with shopify theme dev #5890

@reeswell

Description

@reeswell

Please confirm that you have:

  • Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

Theme

Expected behavior

The CLI should successfully render the storefront through the configured HTTP proxy.

Actual behavior

The CLI fails to render the storefront with a 502 Bad Gateway error, despite proper proxy configuration.

Verbose output

Verbose output
Failed to render storefront with status 502 (Bad Gateway).
URL: [REDACTED]

TypeError: fetch failed
  at node:internal/deps/undici/undici:13510:13
  at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
  at async render2 [...]
  at async Object.handler [...]
  at async Server.<anonymous> [...]

Reproduction steps

1.Set HTTP proxy environment variables:

$env:SHOPIFY_HTTP_PROXY = "http://127.0.0.1:PORT"
$env:SHOPIFY_HTTPS_PROXY = "http://127.0.0.1:PORT"
2.Run shopify theme dev -e development
3.CLI starts successfully and provides preview URLs
4.Immediately encounters 502 Bad Gateway error

### Operating System

Windows 11

### Shopify CLI version (`shopify --version`)

@shopify/cli/0.0.0-snapshot-20250313171017

### Shell

powershell

### Node version (run `node -v` if you're not sure)

v22.15.1

### What language and version are you using in your application?

_No response_

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions