This commit is contained in:
@@ -34,6 +34,20 @@ reset_case() {
|
||||
demo.example.com.conf
|
||||
}
|
||||
|
||||
assert_compression_config() {
|
||||
local config_file="$1"
|
||||
grep -q '^ gzip on;' "$config_file"
|
||||
grep -q '^ gzip_vary on;' "$config_file"
|
||||
grep -q '^ gzip_min_length 1024;' "$config_file"
|
||||
grep -q '^ application/javascript$' "$config_file"
|
||||
grep -q '^ text/css$' "$config_file"
|
||||
grep -q '^ text/javascript$' "$config_file"
|
||||
if grep -q 'text/event-stream' "$config_file"; then
|
||||
echo "Unexpected SSE compression type in $config_file" >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
sed -i.bak 's/^SERVER_HTTP_PORT=.*/SERVER_HTTP_PORT=4100/' .env.sample
|
||||
rm -f .env.sample.bak
|
||||
DEPLOY_NON_INTERACTIVE=1 \
|
||||
@@ -60,6 +74,7 @@ grep -q 'proxy_set_header X-Forwarded-Host $easyai_forwarded_host;' demo.example
|
||||
grep -q 'proxy_set_header X-Forwarded-Port $server_port;' demo.example.com.conf
|
||||
grep -q "proxy_set_header X-Original-Prefix '/api';" demo.example.com.conf
|
||||
grep -q 'location = /api {' demo.example.com.conf
|
||||
assert_compression_config demo.example.com.conf
|
||||
|
||||
# 直接验证 https.sh 的缺省配置生成函数会采用完整模板,而不是只代理 3010。
|
||||
eval "$(awk '
|
||||
@@ -74,6 +89,7 @@ grep -q 'location /api/ {' easyai-proxy.conf
|
||||
grep -q 'proxy_pass http://127.0.0.1:3001/;' easyai-proxy.conf
|
||||
grep -q 'location /socket.io {' easyai-proxy.conf
|
||||
grep -q 'proxy_set_header X-Forwarded-Host $easyai_forwarded_host;' easyai-proxy.conf
|
||||
assert_compression_config easyai-proxy.conf
|
||||
|
||||
reset_case
|
||||
DEPLOY_NON_INTERACTIVE=1 \
|
||||
|
||||
Reference in New Issue
Block a user