|
|
@@ -0,0 +1,82 @@
|
|
|
+server {
|
|
|
+ listen %ip%:%proxy_port%;
|
|
|
+ server_name %webmail_alias%.*;
|
|
|
+
|
|
|
+ location / {
|
|
|
+ proxy_pass http://%ip%:%web_port%;
|
|
|
+ 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)$ {
|
|
|
+ alias /var/lib/roundcube/;
|
|
|
+ expires 15m;
|
|
|
+ try_files $uri @fallback;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ location /error/ {
|
|
|
+ alias /var/www/document_errors/;
|
|
|
+ }
|
|
|
+
|
|
|
+ location ~ /(config|temp|logs) {
|
|
|
+ return 404;
|
|
|
+ }
|
|
|
+
|
|
|
+ location ~ ^/(.*\.php)$ {
|
|
|
+ alias /var/lib/roundcube/$1;
|
|
|
+ fastcgi_pass 127.0.0.1:9000;
|
|
|
+ fastcgi_index index.php;
|
|
|
+ include fastcgi_params;
|
|
|
+ fastcgi_param SCRIPT_FILENAME $request_filename;
|
|
|
+ }
|
|
|
+
|
|
|
+ location @fallback {
|
|
|
+ proxy_pass http://%ip%:%web_port%;
|
|
|
+ }
|
|
|
+
|
|
|
+ location ~ /\.ht {return 404;}
|
|
|
+ location ~ /\.svn/ {return 404;}
|
|
|
+ location ~ /\.git/ {return 404;}
|
|
|
+ location ~ /\.hg/ {return 404;}
|
|
|
+ location ~ /\.bzr/ {return 404;}
|
|
|
+}
|
|
|
+
|
|
|
+server {
|
|
|
+ listen %ip%:%proxy_ssl_port% ssl http2;
|
|
|
+ server_name %webmail_alias%.*;
|
|
|
+ ssl_certificate /usr/local/hestia/ssl/certificate.crt;
|
|
|
+ ssl_certificate_key /usr/local/hestia/ssl/certificate.key;
|
|
|
+
|
|
|
+ location / {
|
|
|
+ proxy_pass https://%ip%:%web_ssl_port%;
|
|
|
+ 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)$ {
|
|
|
+ alias /var/lib/roundcube/;
|
|
|
+ expires 15m;
|
|
|
+ try_files $uri @fallback;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ location /error/ {
|
|
|
+ alias /var/www/document_errors/;
|
|
|
+ }
|
|
|
+
|
|
|
+ location ~ /(config|temp|logs) {
|
|
|
+ return 404;
|
|
|
+ }
|
|
|
+
|
|
|
+ location ~ ^/(.*\.php)$ {
|
|
|
+ alias /var/lib/roundcube/$1;
|
|
|
+ fastcgi_pass 127.0.0.1:9000;
|
|
|
+ fastcgi_index index.php;
|
|
|
+ include fastcgi_params;
|
|
|
+ fastcgi_param SCRIPT_FILENAME $request_filename;
|
|
|
+ }
|
|
|
+
|
|
|
+ location @fallback {
|
|
|
+ proxy_pass https://%ip%:%web_ssl_port%;
|
|
|
+ }
|
|
|
+
|
|
|
+ location ~ /\.ht {return 404;}
|
|
|
+ location ~ /\.svn/ {return 404;}
|
|
|
+ location ~ /\.git/ {return 404;}
|
|
|
+ location ~ /\.hg/ {return 404;}
|
|
|
+ location ~ /\.bzr/ {return 404;}
|
|
|
+
|
|
|
+}
|