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 @@ -