chore: release v1.7.78-alpha
This commit is contained in:
@@ -58,6 +58,32 @@ for row in rows:
|
||||
# NPM containers use this name to reach host-published services; host nginx
|
||||
# itself should use loopback for the same services.
|
||||
nginx_host = "127.0.0.1" if host == "host.containers.internal" else host
|
||||
try:
|
||||
forward_port = int(port)
|
||||
except (TypeError, ValueError):
|
||||
forward_port = None
|
||||
is_saleor = forward_port == 9010
|
||||
graphql_location = ""
|
||||
saleor_proxy_headers = ""
|
||||
if is_saleor:
|
||||
graphql_location = """
|
||||
location ^~ /graphql/ {
|
||||
proxy_pass http://127.0.0.1:8000/graphql/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host 127.0.0.1;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Forwarded-Scheme https;
|
||||
proxy_set_header Origin "";
|
||||
}
|
||||
"""
|
||||
saleor_proxy_headers = """
|
||||
proxy_set_header Accept-Encoding "";
|
||||
sub_filter_once off;
|
||||
sub_filter_types text/html;
|
||||
sub_filter '</head>' '<script>if(window.__SALEOR_CONFIG__){window.__SALEOR_CONFIG__.API_URL=location.origin+"/graphql/";window.__SALEOR_CONFIG__.EXTENSIONS_API_URL=location.origin+"/graphql/";}</script></head>';
|
||||
"""
|
||||
|
||||
print(f"""
|
||||
server {{
|
||||
@@ -81,6 +107,8 @@ server {{
|
||||
ssl_certificate {cert};
|
||||
ssl_certificate_key {key};
|
||||
|
||||
{graphql_location}
|
||||
|
||||
location / {{
|
||||
proxy_pass {scheme}://{nginx_host}:{port};
|
||||
proxy_http_version 1.1;
|
||||
@@ -91,6 +119,7 @@ server {{
|
||||
proxy_set_header X-Forwarded-Scheme https;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
{saleor_proxy_headers}
|
||||
}}
|
||||
}}
|
||||
""")
|
||||
|
||||
Reference in New Issue
Block a user