Skip to content

Commit c949809

Browse files
author
Kristan Kenney
committed
Fixes for force-SSL
1 parent b5cab1a commit c949809

34 files changed

+41
-44
lines changed

bin/v-add-mail-domain-ssl-force

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,23 @@ if [ "$SSL" != 'yes' ]; then
4343
exit $E_NOTEXIST
4444
fi
4545

46+
# Update mail templates
47+
$BIN/v-update-mail-templates
48+
4649
# Check if proxy is active
50+
4751
if [ ! -z "$PROXY_SYSTEM" ] || [ ! -z "$PROXY" ]; then
48-
if ! grep --quiet "forcessl" $HESTIA/data/templates/mail/nginx/default.tpl; then
49-
$BIN/v-update-mail-templates
50-
fi
5152
forcessl="/home/$user/conf/mail/$domain/$PROXY_SYSTEM.forcessl.conf"
5253
else
53-
if ! grep --quiet "forcessl" $HESTIA/data/templates/mail/nginx/default.tpl; then
54-
$BIN/v-update-mail-templates
55-
fi
5654
forcessl="/home/$user/conf/mail/$domain/$WEB_SYSTEM.forcessl.conf"
5755
fi
5856

5957
# Insert redirect commands
60-
if [ ! -z $PROXY ]; then
58+
if [ ! -z "$PROXY_SYSTEM" ]; then
6159
echo 'return 301 https://$server_name$request_uri;' > $forcessl
62-
ln -s $forcessl /etc/$PROXY_SYSTEM/conf.d/domains/$WEBMAIL_ALIAS.$domain.forcessl.conf
6360
else
6461
echo 'RewriteEngine On' > $forcessl
6562
echo 'RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]' >> $forcessl
66-
ln -s $forcessl /etc/$WEB_SYSTEM/conf.d/domains/$WEBMAIL_ALIAS.$domain.forcessl.conf
6763
fi
6864

6965
#----------------------------------------------------------#

install/deb/multiphp/nginx/PHP-56.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ server {
77
access_log /var/log/nginx/domains/%domain%.bytes bytes;
88
error_log /var/log/nginx/domains/%domain%.error.log error;
99
10-
include %home%/%user%/conf/web/%domain%/forcessl.nginx.conf*;
10+
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
1111
1212
location / {
1313

install/deb/multiphp/nginx/PHP-70.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ server {
77
access_log /var/log/nginx/domains/%domain%.bytes bytes;
88
error_log /var/log/nginx/domains/%domain%.error.log error;
99
10-
include %home%/%user%/conf/web/%domain%/forcessl.nginx.conf*;
10+
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
1111
1212
location / {
1313

install/deb/multiphp/nginx/PHP-71.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ server {
77
access_log /var/log/nginx/domains/%domain%.bytes bytes;
88
error_log /var/log/nginx/domains/%domain%.error.log error;
99
10-
include %home%/%user%/conf/web/%domain%/forcessl.nginx.conf*;
10+
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
1111
1212
location / {
1313

install/deb/multiphp/nginx/PHP-72.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ server {
77
access_log /var/log/nginx/domains/%domain%.bytes bytes;
88
error_log /var/log/nginx/domains/%domain%.error.log error;
99
10-
include %home%/%user%/conf/web/%domain%/forcessl.nginx.conf*;
10+
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
1111
1212
location / {
1313

install/deb/multiphp/nginx/PHP-73.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ server {
77
access_log /var/log/nginx/domains/%domain%.bytes bytes;
88
error_log /var/log/nginx/domains/%domain%.error.log error;
99
10-
include %home%/%user%/conf/web/%domain%/forcessl.nginx.conf*;
10+
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
1111
1212
location / {
1313

install/deb/templates/mail/apache2/default.stpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
SSLCertificateFile %home%/%user%/conf/mail/%root_domain%/ssl/%root_domain%.crt
1313
SSLCertificateKeyFile %home%/%user%/conf/mail/%root_domain%/ssl/%root_domain%.key
1414

15-
IncludeOptional %home%/%user%/conf/web/%root_domain%/apache2.forcessl.conf*
15+
IncludeOptional %home%/%user%/conf/mail/%root_domain%/apache2.forcessl.conf*
1616

1717
<Directory "/usr/share/tinymce/www/">
1818
Options Indexes MultiViews FollowSymLinks
@@ -30,7 +30,7 @@
3030
allow from all
3131
</Directory>
3232

33-
<Directory /usr/share/z-push>
33+
<Directory /usr/share/z-push/>
3434
# Don't list a directory index, follow symlinks (maybe state dir is somewhere linked)
3535
DirectoryIndex index.php
3636
Options -Indexes +FollowSymLinks

install/deb/templates/mail/nginx/default.stpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ server {
5252
location ~ /\.hg/ {return 404;}
5353
location ~ /\.bzr/ {return 404;}
5454

55-
include %home%/%user%/conf/mail/%root_domain%/nginx.ssl.conf_*;
55+
include %home%/%user%/conf/mail/%root_domain%/%proxy_system%.ssl.conf_*;
5656
}
5757

install/deb/templates/mail/nginx/default.tpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ server {
22
listen %ip%:%proxy_port%;
33
server_name %domain% %alias%;
44
5-
include %home%/%user%/conf/mail/%domain%/nginx.forcessl.conf*;
5+
include %home%/%user%/conf/mail/%root_domain%/nginx.forcessl.conf*;
6+
67
location / {
78
proxy_pass http://%ip%:%web_port%;
89
location ~* ^.+\.(jpg,jpeg,gif,png,ico,svg,css,zip,tgz,gz,rar,bz2,doc,xls,exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp,rtf,js,mp3,avi,mpeg,flv,html,htm)$ {
@@ -38,5 +39,5 @@ server {
3839
location ~ /\.hg/ {return 404;}
3940
location ~ /\.bzr/ {return 404;}
4041

41-
include %home%/%user%/conf/mail/%root_domain%/nginx.conf_*;
42+
include %home%/%user%/conf/mail/%root_domain%/%proxy_system%.conf_*;
4243
}

install/deb/templates/web/nginx/caching.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ server {
22
listen %ip%:%proxy_port%;
33
server_name %domain_idn% %alias_idn%;
44
5-
include %home%/%user%/conf/web/%domain%/forcessl.nginx.conf*;
5+
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
66
77
location / {
88
proxy_pass http://%ip%:%web_port%;

0 commit comments

Comments
 (0)