There was an error while loading. Please reload this page.
1 parent b4e2563 commit 65ce17eCopy full SHA for 65ce17e
1 file changed
init.sh
@@ -1,5 +1,7 @@
1
#!/bin/bash
2
#
3
+https_port=${HTTPS_PORT:-443}
4
+
5
6
function config_nginx() {
7
config_file=$1
@@ -72,7 +74,12 @@ function config_https() {
72
74
config_nginx "${config_file}"
73
75
76
sed -i "s@server web:.*;@server localhost:51980;@g" "${config_file}"
- sed -i 's@https://$server_name$request_uri;@https://$host$request_uri;@g' "${config_file}"
77
+ if [ "${HTTPS_PORT}" != "443" ]; then
78
+ # Old
79
+ sed -i "s@https://\$server_name\$request_uri;@https://\$host:${HTTPS_PORT}\$request_uri;@g" "${config_file}"
80
+ # New
81
+ sed -i "s@https://\$host\$request_uri;@https://\$host:${HTTPS_PORT}\$request_uri;@g" "${config_file}"
82
+ fi
83
84
if [ "${USE_IPV6}" == "1" ]; then
85
sed -i "s@# listen \[::\]:443@listen \[::\]:443@g" "${config_file}"
0 commit comments