Skip to content

Commit 09cf06d

Browse files
Merge pull request hestiacp#944 from ioannidesalex/patch-22
Support for Sendy with nginx (SSL)
2 parents b5c0a83 + be06a05 commit 09cf06d

File tree

1 file changed

+75
-0
lines changed
  • install/ubuntu/16.04/templates/web/nginx/php-fpm

1 file changed

+75
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
server {
2+
listen %ip%:%web_ssl_port%;
3+
server_name %domain_idn% %alias_idn%;
4+
root %sdocroot%;
5+
index index.php index.html index.htm;
6+
access_log /var/log/nginx/domains/%domain%.log combined;
7+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
8+
error_log /var/log/nginx/domains/%domain%.error.log error;
9+
10+
ssl on;
11+
ssl_certificate %ssl_pem%;
12+
ssl_certificate_key %ssl_key%;
13+
14+
if (!-f $request_filename){
15+
rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last;
16+
}
17+
18+
location / {
19+
index index.php;
20+
21+
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
22+
expires max;
23+
}
24+
25+
location ~ [^/]\.php(/|$) {
26+
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;
34+
}
35+
36+
location /l/ {
37+
rewrite ^/l/([a-zA-Z0-9/]+)$ /l.php?i=$1 last;
38+
}
39+
40+
location /t/ {
41+
rewrite ^/t/([a-zA-Z0-9/]+)$ /t.php?i=$1 last;
42+
}
43+
44+
location /w/ {
45+
rewrite ^/w/([a-zA-Z0-9/]+)$ /w.php?i=$1 last;
46+
}
47+
48+
location /unsubscribe/ {
49+
rewrite ^/unsubscribe/(.*)$ /unsubscribe.php?i=$1 last;
50+
}
51+
52+
location /subscribe/ {
53+
rewrite ^/subscribe/(.*)$ /subscribe.php?i=$1 last;
54+
}
55+
}
56+
57+
error_page 403 /error/404.html;
58+
error_page 404 /error/404.html;
59+
error_page 500 502 503 504 /error/50x.html;
60+
61+
location /error/ {
62+
alias %home%/%user%/web/%domain%/document_errors/;
63+
}
64+
65+
location ~* "/\.(htaccess|htpasswd)$" {
66+
deny all;
67+
return 404;
68+
}
69+
70+
include /etc/nginx/conf.d/phpmyadmin.inc*;
71+
include /etc/nginx/conf.d/phppgadmin.inc*;
72+
include /etc/nginx/conf.d/webmail.inc*;
73+
74+
include %home%/%user%/conf/web/snginx.%domain%.conf*;
75+
}

0 commit comments

Comments
 (0)