Skip to content

Commit 65ce17e

Browse files
committed
perf: update web login
1 parent b4e2563 commit 65ce17e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

init.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22
#
3+
https_port=${HTTPS_PORT:-443}
4+
35

46
function config_nginx() {
57
config_file=$1
@@ -72,7 +74,12 @@ function config_https() {
7274
config_nginx "${config_file}"
7375

7476
sed -i "s@server web:.*;@server localhost:51980;@g" "${config_file}"
75-
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
7683

7784
if [ "${USE_IPV6}" == "1" ]; then
7885
sed -i "s@# listen \[::\]:443@listen \[::\]:443@g" "${config_file}"

0 commit comments

Comments
 (0)