From 7986f367ca4e7613006a1e37587b60d52dcf4a5d Mon Sep 17 00:00:00 2001 From: XieYongHong <18010623010@163.com> Date: Tue, 12 Dec 2023 15:10:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96nginx=E9=85=8D?= =?UTF-8?q?=E7=BD=AEserver=5Fname?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 优化lodash-es * fix: 优化nginx配置server_name --- docker-entrypoint.sh | 7 ++++++ nginx.conf | 2 +- src/components/Layout/SinglePage.vue | 2 +- src/utils/tree.ts | 2 +- .../Diagnose/Status/DiagnosticAdvice.tsx | 4 ++-- .../Instance/Detail/Diagnose/Status/index.tsx | 6 ++--- src/views/iframe/index.vue | 24 ++++++++++++++----- 7 files changed, 33 insertions(+), 14 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index c57efdd4..917ccab7 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,14 +1,21 @@ #!/usr/bin/env bash API_BASE_PATH=$API_BASE_PATH; +SERVER_NAME=$SERVER_NAME NAMESERVERS=$(cat /etc/resolv.conf | grep "nameserver" | awk '{print $2}' | tr '\n' ' ') if [ -z "$API_BASE_PATH" ]; then API_BASE_PATH="http://jetlinks:8844/"; fi +if [ -z "$SERVER_NAME" ]; then + SERVER_NAME="localhost"; +fi + apiUrl="proxy_pass $API_BASE_PATH\$1;" resolver="resolver $NAMESERVERS ipv6=off;" +serverName="server_name $SERVER_NAME;" +sed -i '4c '"$serverName"'' /etc/nginx/conf.d/default.conf sed -i '11c '"$resolver"'' /etc/nginx/conf.d/default.conf sed -i '20c '"$apiUrl"'' /etc/nginx/conf.d/default.conf diff --git a/nginx.conf b/nginx.conf index 92401367..47e6d6e0 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,7 +1,7 @@ server { listen 80; listen [::]:80; - # gzip config + server_name _; gzip on; gzip_min_length 1k; gzip_comp_level 9; diff --git a/src/components/Layout/SinglePage.vue b/src/components/Layout/SinglePage.vue index c2f0fd49..f65e69e3 100644 --- a/src/components/Layout/SinglePage.vue +++ b/src/components/Layout/SinglePage.vue @@ -25,7 +25,7 @@ -