forked from wazuh/wazuh-docker
Merge pull request #377 from wazuh/bugfix-port-80-redirects
Bugfix port 80 redirects
This commit is contained in:
@@ -52,11 +52,14 @@ if [ "x${KIBANA_HOST}" = "x" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Configuring NGINX"
|
echo "Configuring NGINX"
|
||||||
|
|
||||||
|
|
||||||
|
if [ "${NGINX_PORT}" = "443" ]; then
|
||||||
cat > /etc/nginx/conf.d/default.conf <<EOF
|
cat > /etc/nginx/conf.d/default.conf <<EOF
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
return 301 https://\$host:${NGINX_PORT}\$request_uri;
|
return 301 https://\$host\$request_uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
@@ -74,5 +77,21 @@ server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
else
|
||||||
|
cat > /etc/nginx/conf.d/default.conf <<EOF
|
||||||
|
server {
|
||||||
|
listen ${NGINX_PORT};
|
||||||
|
listen [::]:${NGINX_PORT};
|
||||||
|
location / {
|
||||||
|
auth_basic "Restricted";
|
||||||
|
auth_basic_user_file /etc/nginx/conf.d/kibana.htpasswd;
|
||||||
|
proxy_pass http://${KIBANA_HOST}/;
|
||||||
|
proxy_buffer_size 128k;
|
||||||
|
proxy_buffers 4 256k;
|
||||||
|
proxy_busy_buffers_size 256k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
exec nginx -g 'daemon off;'
|
exec nginx -g 'daemon off;'
|
||||||
|
|||||||
Reference in New Issue
Block a user