App proxy issue in theme extension

Developing a theme extension. When trying to call my API via proxy, it giving 404, no logs find on API server. If I call the API directly without any proxy, it works fine.

.toml file
[access_scopes]

scopes = “write_products,write_app_proxy”
[app_proxy]
url = “https://domain.com
subpath = “vir_ton”
prefix = “apps”

js file

const resp = await fetch(“/apps/vir_ton/get_token”, {
method: ‘POST’,
headers: { ‘Content-Type’: ‘application/json’ },
credentials: ‘same-origin’
});

Shopify error log

ErrorResponseImpl {
12:06:43 │ React Router │ status: 404,
12:06:43 │ React Router │ statusText: ‘Not Found’,
12:06:43 │ React Router │ internal: true,
12:06:43 │ React Router │ data: ‘Error: No route matches URL “/get_token”’,
12:06:43 │ React Router │ error: Error: No route matches URL “/get_token”

Any idea to resolve the same

In my debugging, its looking like the proxy url calls the ngrok proxy instaed of app proxy url. I am using ngrok tunneling to run the shopify app locally. Any solution for this

Hi @JOSEPH_ALEXANDER

At the moment, the automatically_update_urls_on_dev setting is all-or-nothing for your App URL, Redirect URLs, and App Proxy URL.

If your App Proxy is at a different host, the common workaround is to use a static URL during development (such as a paid ngrok account), and disabling this setting in your app toml.

Hi @NickWesselman
Thank you for your reply.
I am using a static domain for the API hosting and Shopify running via ngrok tunneling. The proxy requests not reaching the API server.

Can you post your app toml? Have you tried disabling automatically_update_urls_on_dev?

Hi @NickWesselman

client_id = “######5feb4
name = “V#####on
application_url = “https://example.com
embedded = true

[build]
automatically_update_urls_on_dev = true
include_config_on_deploy = true

[webhooks]
api_version = “2026-01”

[[webhooks.subscriptions]]
topics = [ “app/uninstalled” ]
uri = “/webhooks/app/uninstalled”

[[webhooks.subscriptions]]
topics = [ “app/scopes_update” ]
uri = “/webhooks/app/scopes_update”

[access_scopes]

scopes = “write_products,write_app_proxy”

[auth]
redirect_urls = [ “https://example.com/api/auth” ]
[app_proxy]
url = “https://3333.net.in
subpath = “virtual_tryon”
prefix = “apps”

1 Like

That worked. Thank you so much