fix(apps): proxy saleor storefront media

This commit is contained in:
archipelago
2026-05-22 17:08:03 -04:00
parent 68784be4db
commit 626a89bdbc
2 changed files with 24 additions and 0 deletions

View File

@@ -581,6 +581,8 @@ fn saleor_storefront_app_command() -> tokio::process::Command {
"-e",
"NEXT_PUBLIC_SALEOR_API_URL=http://api:8000/graphql/",
"-e",
"NEXT_PUBLIC_SALEOR_MEDIA_URL=http://api:8000/",
"-e",
"NEXT_PUBLIC_STOREFRONT_URL=http://localhost:9011",
"-e",
"NEXT_PUBLIC_DEFAULT_CHANNEL=default-channel",
@@ -2300,6 +2302,7 @@ server {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
location ^~ /graphql/ {
@@ -2309,6 +2312,20 @@ server {
proxy_set_header Origin "";
}
location ^~ /thumbnail/ {
set $saleor_media http://api:8000$request_uri;
proxy_pass $saleor_media;
proxy_set_header Host api;
proxy_set_header Origin "";
}
location ^~ /media/ {
set $saleor_media http://api:8000$request_uri;
proxy_pass $saleor_media;
proxy_set_header Host api;
proxy_set_header Origin "";
}
location / {
set $saleor_storefront_app http://storefront-app:3000;
proxy_pass $saleor_storefront_app;