Skip to content

Commit d6f9ab6

Browse files
Merge pull request hestiacp#1401 from ioannidesalex/patch-19
Tweaks & HTTP/2 support
2 parents 93457fe + d2bf098 commit d6f9ab6

File tree

1 file changed

+36
-23
lines changed
  • install/ubuntu/16.04/templates/web/nginx/php-fpm

1 file changed

+36
-23
lines changed

install/ubuntu/16.04/templates/web/nginx/php-fpm/sendy.stpl

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,49 @@
11
server {
2-
listen %ip%:%web_ssl_port%;
2+
listen %ip%:%web_ssl_port% ssl http2;
33
server_name %domain_idn% %alias_idn%;
4-
root %sdocroot%;
4+
ssl_certificate %ssl_pem%;
5+
ssl_certificate_key %ssl_key%;
6+
root %docroot%;
57
index index.php index.html index.htm;
68
access_log /var/log/nginx/domains/%domain%.log combined;
79
access_log /var/log/nginx/domains/%domain%.bytes bytes;
810
error_log /var/log/nginx/domains/%domain%.error.log error;
911

10-
ssl on;
11-
ssl_certificate %ssl_pem%;
12-
ssl_certificate_key %ssl_key%;
12+
location = /favicon.ico {
13+
log_not_found off;
14+
access_log off;
15+
}
1316

14-
if (!-f $request_filename){
15-
rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last;
16-
}
17+
location = /robots.txt {
18+
allow all;
19+
log_not_found off;
20+
access_log off;
21+
}
1722

18-
location / {
19-
index index.php;
23+
location ~* "/\.(htaccess|htpasswd|git|svn|DS_Store)$" {
24+
deny all;
25+
}
26+
27+
location ~ /(readme.html|license.txt) {
28+
deny all;
29+
}
2030

21-
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
22-
expires max;
31+
if (!-f $request_filename){
32+
rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last;
33+
}
34+
35+
location / {
36+
try_files $uri $uri/ /index.php?$args;
37+
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|pdf)$ {
38+
expires 1d;
2339
}
2440

2541
location ~ [^/]\.php(/|$) {
2642
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
27-
if (!-f $document_root$fastcgi_script_name) {
28-
return 404;
29-
}
30-
31-
fastcgi_pass %backend_lsnr%;
32-
fastcgi_index index.php;
33-
include /etc/nginx/fastcgi_params;
43+
try_files $uri =404;
44+
fastcgi_pass %backend_lsnr%;
45+
fastcgi_index index.php;
46+
include /etc/nginx/fastcgi_params;
3447
}
3548

3649
location /l/ {
@@ -62,14 +75,14 @@ server {
6275
alias %home%/%user%/web/%domain%/document_errors/;
6376
}
6477

65-
location ~* "/\.(htaccess|htpasswd)$" {
66-
deny all;
67-
return 404;
78+
location /vstats/ {
79+
alias %home%/%user%/web/%domain%/stats/;
80+
include %home%/%user%/web/%domain%/stats/auth.conf*;
6881
}
6982

7083
include /etc/nginx/conf.d/phpmyadmin.inc*;
7184
include /etc/nginx/conf.d/phppgadmin.inc*;
7285
include /etc/nginx/conf.d/webmail.inc*;
7386

74-
include %home%/%user%/conf/web/snginx.%domain%.conf*;
87+
include %home%/%user%/conf/web/nginx.%domain%.conf*;
7588
}

0 commit comments

Comments
 (0)