Merge pull request #239 from FirmlyReality/master

remove  in nginx_docklet.conf when nginx_port=80
This commit is contained in:
Yujian Zhu 2017-05-16 00:46:49 +08:00 committed by GitHub
commit 3a25964b0b
2 changed files with 8 additions and 1 deletions

View File

@ -11,7 +11,7 @@ server
location ~ ^/(\d+\.\d+\.\d+\.\d+)/ {
proxy_pass http://%PROXY_SERVER_IP:%PROXY_PORT;
proxy_set_header Host $host:$server_port;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";

View File

@ -29,5 +29,12 @@ fi
sed -i "s/%PROXY_PORT/${PROXY_PORT}/g" ${NGINX_CONF}/nginx_docklet.conf
sed -i "s/%WEB_PORT/${WEB_PORT}/g" ${NGINX_CONF}/nginx_docklet.conf
if [ "${NGINX_PORT}" != "80" ]
then
sed -i "s/\$host/\$host:\$server_port/g" ${NGINX_CONF}/nginx_docklet.conf
fi
echo "restart nginx..."
/etc/init.d/nginx restart