Browse Source

Fix webmail alias for php-fpm configurations

Kristan Kenney 6 years ago
parent
commit
da2550a9f3

+ 10 - 8
install/deb/templates/mail/nginx/default.stpl

@@ -4,7 +4,7 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
     root        /var/lib/roundcube;
     root        /var/lib/roundcube;
-    index       index.php;
+    index       index.php index.html index.htm;
     
     
     location / {
     location / {
         proxy_pass http://%ip%:%web_port%;
         proxy_pass http://%ip%:%web_port%;
@@ -44,18 +44,20 @@ server {
         fastcgi_index index.php;
         fastcgi_index index.php;
         include fastcgi_params;
         include fastcgi_params;
         fastcgi_param SCRIPT_FILENAME $request_filename;
         fastcgi_param SCRIPT_FILENAME $request_filename;
+        fastcgi_param HTTPS on;
     }
     }
     
     
-    location @fallback {
-        proxy_pass http://%ip%:%web_port%;
-    }
-
     error_page 403 /error/404.html;
     error_page 403 /error/404.html;
     error_page 404 /error/404.html;
     error_page 404 /error/404.html;
-    error_page 500 502 503 504 /error/50x.html;
-
+    error_page 500 502 503 504 505 /error/50x.html;
+    
     location /error/ {
     location /error/ {
-        alias   /var/www/document_errors/;
+        alias       /var/www/document_errors/;
+        try_files   $uri $uri/;
+    }
+
+    location @fallback {
+        proxy_pass http://%ip%:%web_port%;
     }
     }
 
 
     include %home%/%user%/conf/mail/%root_domain%/%proxy_system%.conf_*;
     include %home%/%user%/conf/mail/%root_domain%/%proxy_system%.conf_*;

+ 8 - 7
install/deb/templates/mail/nginx/default.tpl

@@ -2,7 +2,7 @@ server {
     listen      %ip%:%proxy_port%;
     listen      %ip%:%proxy_port%;
     server_name %domain% %alias%;
     server_name %domain% %alias%;
     root        /var/lib/roundcube;
     root        /var/lib/roundcube;
-    index       index.php;
+    index       index.php index.html index.htm;
 
 
     include %home%/%user%/conf/mail/%root_domain%/nginx.forcessl.conf*;
     include %home%/%user%/conf/mail/%root_domain%/nginx.forcessl.conf*;
 
 
@@ -46,16 +46,17 @@ server {
         fastcgi_param SCRIPT_FILENAME $request_filename;
         fastcgi_param SCRIPT_FILENAME $request_filename;
     }
     }
     
     
-    location @fallback {
-        proxy_pass http://%ip%:%web_port%;
-    }
-
     error_page 403 /error/404.html;
     error_page 403 /error/404.html;
     error_page 404 /error/404.html;
     error_page 404 /error/404.html;
-    error_page 500 502 503 504 /error/50x.html;
+    error_page 500 502 503 504 505 /error/50x.html;
 
 
     location /error/ {
     location /error/ {
-        alias   /var/www/document_errors/;
+        alias       /var/www/document_errors/;
+        try_files   $uri $uri/;
+    }
+
+    location @fallback {
+        proxy_pass http://%ip%:%web_port%;
     }
     }
 
 
     include %home%/%user%/conf/mail/%root_domain%/%proxy_system%.conf_*;
     include %home%/%user%/conf/mail/%root_domain%/%proxy_system%.conf_*;

+ 5 - 4
install/deb/templates/mail/nginx/web_system.stpl

@@ -4,14 +4,13 @@ server {
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
     root        /var/lib/roundcube;
     root        /var/lib/roundcube;
-    index       index.php;
+    index       index.php index.html index.htm;
    
    
     location =/ {
     location =/ {
         try_files $uri $uri/ /index.php?q=$uri&$args;
         try_files $uri $uri/ /index.php?q=$uri&$args;
     }
     }
     
     
     location / {
     location / {
-        try_files $uri $uri/ /index.php?q=$uri&$args;
         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)$ {
         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)$ {
             expires 1h;
             expires 1h;
             fastcgi_hide_header "Set-Cookie";
             fastcgi_hide_header "Set-Cookie";
@@ -46,14 +45,16 @@ server {
         fastcgi_index index.php;
         fastcgi_index index.php;
         include fastcgi_params;
         include fastcgi_params;
         fastcgi_param SCRIPT_FILENAME $request_filename;
         fastcgi_param SCRIPT_FILENAME $request_filename;
+        fastcgi_param HTTPS on;
     }
     }
     
     
     error_page 403 /error/404.html;
     error_page 403 /error/404.html;
     error_page 404 /error/404.html;
     error_page 404 /error/404.html;
-    error_page 500 502 503 504 /error/50x.html;
+    error_page 500 502 503 504 505 /error/50x.html;
 
 
     location /error/ {
     location /error/ {
-        alias   /var/www/document_errors/;
+        alias       /var/www/document_errors/;
+        try_files   $uri $uri/;
     }
     }
 
 
     include %home%/%user%/conf/mail/%root_domain%/%web_system%.conf_*;
     include %home%/%user%/conf/mail/%root_domain%/%web_system%.conf_*;

+ 5 - 6
install/deb/templates/mail/nginx/web_system.tpl

@@ -2,7 +2,7 @@ server {
     listen      %ip%:%web_port%;
     listen      %ip%:%web_port%;
     server_name %domain% %alias%;
     server_name %domain% %alias%;
     root        /var/lib/roundcube;
     root        /var/lib/roundcube;
-    index       index.php;
+    index       index.php index.html index.htm;
 
 
     include %home%/%user%/conf/mail/%root_domain%/nginx.forcessl.conf*;
     include %home%/%user%/conf/mail/%root_domain%/nginx.forcessl.conf*;
 
 
@@ -11,8 +11,7 @@ server {
     }
     }
 
 
     location / {
     location / {
-        try_files $uri $uri/ /index.php?q=$uri&$args;
-        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)$ {
+       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)$ {
             expires 1h;
             expires 1h;
             fastcgi_hide_header "Set-Cookie";
             fastcgi_hide_header "Set-Cookie";
         }
         }
@@ -50,11 +49,11 @@ server {
     
     
     error_page 403 /error/404.html;
     error_page 403 /error/404.html;
     error_page 404 /error/404.html;
     error_page 404 /error/404.html;
-    error_page 500 502 503 504 /error/50x.html;
+    error_page 500 502 503 504 505 /error/50x.html;
 
 
     location /error/ {
     location /error/ {
-        alias   /var/www/document_errors/;
-
+        alias       /var/www/document_errors/;
+        try_files   $uri $uri/;
     }
     }
 
 
     include %home%/%user%/conf/mail/%root_domain%/%web_system%.conf_*;
     include %home%/%user%/conf/mail/%root_domain%/%web_system%.conf_*;