Skip to content

Commit 668939f

Browse files
author
Kristan Kenney
committed
Disable default global setting for SSL stapling (hestiacp#394)
Due to the potential for errors with SSL certificates, this value should be passed on a domain level instead of globally for nginx.
1 parent d34e615 commit 668939f

File tree

3 files changed

+41
-41
lines changed

3 files changed

+41
-41
lines changed

install/deb/nginx/nginx.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ http {
112112
ssl_dhparam /etc/ssl/dhparam.pem;
113113
ssl_ecdh_curve secp384r1;
114114
ssl_session_tickets off;
115-
ssl_stapling on;
116-
ssl_stapling_verify on;
117115
resolver 1.0.0.1 1.1.1.1 valid=300s ipv6=off;
118116
resolver_timeout 5s;
119117

install/upgrade/versions/1.0.1.sh

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,45 @@ source /usr/local/hestia/conf/hestia.conf
2020

2121
####### Place additional commands below. #######
2222

23-
# Remove global options from nginx.conf to prevent conflicts with other web packages
24-
if [ -e /etc/nginx/nginx.conf ]; then
25-
echo "(*) Updating nginx configuration.."
26-
sed -i "/add_header X-Frame-Options SAMEORIGIN;/d" /etc/nginx/nginx.conf
27-
sed -i "/add_header X-Content-Type-Options nosniff;/d" /etc/nginx/nginx.conf
23+
# Update Apache and Nginx configuration to support new file structure
24+
echo "(*) Updating web server configuration..."
25+
if [ -f /etc/apache2/apache.conf ]; then
26+
mv /etc/apache2/apache.conf $HESTIA_BACKUP/conf/
27+
cp -f $HESTIA/install/deb/apache2/apache.conf /etc/apache2/apache.conf
2828
fi
29+
if [ -f /etc/nginx/nginx.conf ]; then
30+
mv /etc/nginx/nginx.conf $HESTIA_BACKUP/conf/
31+
cp -f $HESTIA/install/deb/nginx/nginx.conf /etc/nginx/nginx.conf
32+
fi
33+
34+
# Generate dhparam
35+
if [ ! -e /etc/ssl/dhparam.pem ]; then
36+
mv /etc/nginx/nginx.conf $HESTIA_BACKUP/conf/
37+
cp -f $hestiacp/nginx/nginx.conf /etc/nginx/
38+
39+
# Copy dhparam
40+
cp -f $hestiacp/ssl/dhparam.pem /etc/ssl/
41+
42+
# Update DNS servers in nginx.conf
43+
dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
44+
for ip in $dns_resolver; do
45+
if [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
46+
resolver="$ip $resolver"
47+
fi
48+
done
49+
if [ ! -z "$resolver" ]; then
50+
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /etc/nginx/nginx.conf
51+
fi
52+
53+
# Remove global options from nginx.conf to prevent conflicts with other web packages
54+
if [ -e /etc/nginx/nginx.conf ]; then
55+
sed -i "/add_header X-Frame-Options SAMEORIGIN;/d" /etc/nginx/nginx.conf
56+
sed -i "/add_header X-Content-Type-Options nosniff;/d" /etc/nginx/nginx.conf
57+
fi
58+
59+
# Restart Nginx service
60+
systemctl restart nginx >/dev/null 2>&1
61+
fi
62+
63+
64+

install/upgrade/versions/1.00.0-190618.sh

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -53,40 +53,6 @@ if [ ! -f /etc/apt/apt.conf.d/80-retries ]; then
5353
echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries
5454
fi
5555

56-
# Update Apache and Nginx configuration to support new file structure
57-
echo "(*) Updating web server configuration..."
58-
if [ -f /etc/apache2/apache.conf ]; then
59-
mv /etc/apache2/apache.conf $HESTIA_BACKUP/conf/
60-
cp -f $HESTIA/install/deb/apache2/apache.conf /etc/apache2/apache.conf
61-
fi
62-
if [ -f /etc/nginx/nginx.conf ]; then
63-
mv /etc/nginx/nginx.conf $HESTIA_BACKUP/conf/
64-
cp -f $HESTIA/install/deb/nginx/nginx.conf /etc/nginx/nginx.conf
65-
fi
66-
67-
# Generate dhparam
68-
if [ ! -e /etc/ssl/dhparam.pem ]; then
69-
mv /etc/nginx/nginx.conf $HESTIA_BACKUP/conf/
70-
cp -f $hestiacp/nginx/nginx.conf /etc/nginx/
71-
72-
# Copy dhparam
73-
cp -f $hestiacp/ssl/dhparam.pem /etc/ssl/
74-
75-
# Update DNS servers in nginx.conf
76-
dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
77-
for ip in $dns_resolver; do
78-
if [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
79-
resolver="$ip $resolver"
80-
fi
81-
done
82-
if [ ! -z "$resolver" ]; then
83-
sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /etc/nginx/nginx.conf
84-
fi
85-
86-
# Restart Nginx service
87-
systemctl restart nginx >/dev/null 2>&1
88-
fi
89-
9056
# Update default page templates
9157
echo "(*) Replacing default templates and packages..."
9258

0 commit comments

Comments
 (0)