Skip to content

Commit 556dfae

Browse files
ioannidesalexKristan Kenney
authored andcommitted
Update nginx configuration, templates, and file permissions for default page template
* Change permissions on index.html * Update web_system.stpl * Update web_system.tpl * Update default.tpl * Update default.stpl * Error codes * Update nginx.conf
1 parent ba924b0 commit 556dfae

File tree

7 files changed

+41
-40
lines changed

7 files changed

+41
-40
lines changed

install/deb/nginx/nginx.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ http {
121121
add_header X-Content-Type-Options nosniff;
122122

123123
# Error pages
124-
error_page 403 /error/403.html;
125-
error_page 404 /error/404.html;
126-
error_page 502 503 504 /error/50x.html;
124+
error_page 403 /error/404.html;
125+
error_page 404 /error/404.html;
126+
error_page 500 501 502 503 504 505 /error/50x.html;
127127

128128
# Cache settings
129129
proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m max_size=1024m;
@@ -147,6 +147,6 @@ http {
147147
open_file_cache_errors off;
148148

149149
# Wildcard include
150-
include /etc/nginx/conf.d/*.conf;
151-
include /etc/nginx/conf.d/domains/*.conf;
150+
include /etc/nginx/conf.d/*.conf;
151+
include /etc/nginx/conf.d/domains/*.conf;
152152
}

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ server {
2020

2121
location / {
2222
proxy_pass https://%ip%:%web_ssl_port%;
23-
try_files $uri $uri/ /index.php?q=$uri&$args;
23+
try_files $uri $uri/ =404;
2424
alias /var/lib/roundcube/;
2525
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
2626
expires 7d;
2727
fastcgi_hide_header "Set-Cookie";
2828
}
29-
}
3029

31-
location ~ ^/(.*\.php)$ {
32-
alias /var/lib/roundcube/$1;
33-
fastcgi_pass 127.0.0.1:9000;
34-
fastcgi_index index.php;
35-
include fastcgi_params;
36-
fastcgi_param SCRIPT_FILENAME $request_filename;
30+
location ~ ^/(.*\.php)$ {
31+
alias /var/lib/roundcube/$1;
32+
fastcgi_pass 127.0.0.1:9000;
33+
fastcgi_index index.php;
34+
include fastcgi_params;
35+
fastcgi_param SCRIPT_FILENAME $request_filename;
36+
}
3737
}
3838

3939
error_page 403 /error/404.html;

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ server {
2020

2121
location / {
2222
proxy_pass http://%ip%:%web_port%;
23-
try_files $uri $uri/ /index.php?q=$uri&$args;
23+
try_files $uri $uri/ =404;
2424
alias /var/lib/roundcube/;
2525
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
2626
expires 7d;
2727
fastcgi_hide_header "Set-Cookie";
2828
}
29-
}
3029

31-
location ~ ^/(.*\.php)$ {
32-
alias /var/lib/roundcube/$1;
33-
fastcgi_pass 127.0.0.1:9000;
34-
fastcgi_index index.php;
35-
include fastcgi_params;
36-
fastcgi_param SCRIPT_FILENAME $request_filename;
30+
location ~ ^/(.*\.php)$ {
31+
alias /var/lib/roundcube/$1;
32+
fastcgi_pass 127.0.0.1:9000;
33+
fastcgi_index index.php;
34+
include fastcgi_params;
35+
fastcgi_param SCRIPT_FILENAME $request_filename;
36+
}
3737
}
3838

3939
error_page 403 /error/404.html;

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ server {
1919
}
2020

2121
location / {
22-
try_files $uri $uri/ /index.php?q=$uri&$args;
22+
try_files $uri $uri/ =404;
2323
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
2424
expires 7d;
2525
fastcgi_hide_header "Set-Cookie";
2626
}
27-
}
2827

29-
location ~ ^/(.*\.php)$ {
30-
alias /var/lib/roundcube/$1;
31-
fastcgi_pass 127.0.0.1:9000;
32-
fastcgi_index index.php;
33-
include fastcgi_params;
34-
fastcgi_param SCRIPT_FILENAME $request_filename;
28+
location ~ ^/(.*\.php)$ {
29+
alias /var/lib/roundcube/$1;
30+
fastcgi_pass 127.0.0.1:9000;
31+
fastcgi_index index.php;
32+
include fastcgi_params;
33+
fastcgi_param SCRIPT_FILENAME $request_filename;
34+
}
3535
}
3636

3737
error_page 403 /error/404.html;

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ server {
1919
}
2020

2121
location / {
22-
try_files $uri $uri/ /index.php?q=$uri&$args;
22+
try_files $uri $uri/ =404;
2323
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
2424
expires 7d;
2525
fastcgi_hide_header "Set-Cookie";
2626
}
27-
}
2827

29-
location ~ ^/(.*\.php)$ {
30-
alias /var/lib/roundcube/$1;
31-
fastcgi_pass 127.0.0.1:9000;
32-
fastcgi_index index.php;
33-
include fastcgi_params;
34-
fastcgi_param SCRIPT_FILENAME $request_filename;
28+
location ~ ^/(.*\.php)$ {
29+
alias /var/lib/roundcube/$1;
30+
fastcgi_pass 127.0.0.1:9000;
31+
fastcgi_index index.php;
32+
include fastcgi_params;
33+
fastcgi_param SCRIPT_FILENAME $request_filename;
34+
}
3535
}
3636

3737
error_page 403 /error/404.html;

install/hst-install-ubuntu.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,7 @@ chmod 751 $HESTIA/data/templates/web/suspend/webfonts
10441044
chmod 751 $HESTIA/data/templates/web/unassigned/css
10451045
chmod 751 $HESTIA/data/templates/web/unassigned/js
10461046
chmod 751 $HESTIA/data/templates/web/unassigned/webfonts
1047+
chmod 644 $HESTIA/data/templates/web/unassigned/index.html
10471048

10481049
mkdir -p /var/www/html
10491050

src/deb/nginx/nginx.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ http {
102102
ssl_certificate /usr/local/hestia/ssl/certificate.crt;
103103
ssl_certificate_key /usr/local/hestia/ssl/certificate.key;
104104

105-
error_page 404 /error/404/index.html;
106-
error_page 403 /error/index.html;
107-
error_page 500 /error/index.html;
105+
error_page 403 /error/404/index.html;
106+
error_page 404 /error/404/index.html;
107+
error_page 500 501 502 503 504 505 /error/index.html;
108108

109109
location / {
110110
expires off;

0 commit comments

Comments
 (0)