fix(apps): proxy saleor storefront media
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user