File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ NGINX_DAEMON=/usr/local/hestia/nginx/sbin/hestia-nginx
1717NGINX_NAME=hestia-nginx
1818NGINX_DESC=hestia-nginx
1919NGINX_PID=/run/hestia-nginx.pid
20+ NGINX_CONF=/usr/local/hestia/nginx/conf/nginx.conf
2021
2122PHP_DAEMON=/usr/local/hestia/php/sbin/hestia-php
2223PHP_NAME=hestia-php
@@ -30,7 +31,23 @@ set -e
3031
3132. /etc/profile.d/hestia.sh
3233
34+ adapt_nginx_config () {
35+ ipv4_string=" $( ip -4 addr show scope global | sed -ne ' /^[ \t]*inet[6]*/p' ) "
36+ ipv6_string=" $( ip -6 addr show scope global | sed -ne ' /^[ \t]*inet[6]*/p' ) "
37+ if [ -n " $ipv4_string " ]; then
38+ sed -i ' s/#IPV4\([ \t]*listen[ \t]*[0-9]\{1,5\}.*\)/\1/' ${NGINX_CONF}
39+ else
40+ sed -i ' s/^\([ \t]*listen[ \t]*[0-9]\{1,5\}.*\)/#IPV4\1/' ${NGINX_CONF}
41+ fi
42+ if [ -n " $ipv6_string " ]; then
43+ sed -i ' s/#IPV6\([ \t]*listen[ \t]*\[\:\:\]\:[0-9]\{1,5\}.*\)/\1/' ${NGINX_CONF}
44+ else
45+ sed -i ' s/^\([ \t]*listen[ \t]*\[\:\:\]\:[0-9]\{1,5\}.*\)/#IPV6\1/' ${NGINX_CONF}
46+ fi
47+ }
48+
3349start_nginx () {
50+ adapt_nginx_config
3451 start-stop-daemon --start --quiet --pidfile $NGINX_PID \
3552 --retry 5 --exec $NGINX_DAEMON --oknodo
3653}
Original file line number Diff line number Diff line change 9292
9393 # Vhost
9494 server {
95- listen 8083 ssl ;
95+ #IPV4 listen 8083 ssl;
96+ #IPV6 listen [::]:8083 ssl;
9697 server_name _;
9798 root /usr/local/hestia/web;
9899 # Fix error "The plain HTTP request was sent to HTTPS port"
You can’t perform that action at this time.
0 commit comments