ソースを参照

Fix custom error pages for static sites

dennisro 5 年 前
コミット
95beb1ff86
1 ファイル変更11 行追加8 行削除
  1. 11 8
      data/services/statichtmlsite/nginx/statichtmlsite.conf

+ 11 - 8
data/services/statichtmlsite/nginx/statichtmlsite.conf

@@ -40,8 +40,7 @@ server {
 	include /etc/nginx/includes/gzip.conf;
 
 	location / {
-                #try_files $uri $uri/ =404;
-                try_files $uri $uri/ /index.php?q=$uri&$args;
+                try_files $uri $uri/ =404;
         }
 
 	expires $expires;
@@ -54,18 +53,22 @@ server {
 
 	fastcgi_intercept_errors on; # make custom errors work
 	
-	error_page   500 502 503 504  /errors/50x.html;
+	error_page   500 502 503 504  /50x.html;
 	location = /50x.html {
-		root   /var/www/errors;
+		root   /var/www/html/errors/;
+		internal;
 	}
 
-	error_page   403   /errors/403.html;
+	error_page   403   /403.html;
 	location = /403.html {
-		root   /var/www/errors;
+		root   /var/www/html/errors/;
+		internal;
 	}
 
-	error_page   404   /errors/404.html;
+	error_page 404 /404.html;
 		location = /404.html {
+		root   /var/www/html/errors/;
+		internal;
 	}
 
 	location ^~ /.well-known/ {
@@ -76,5 +79,5 @@ server {
 	    index                index.html; # "no-such-file.txt",if expected protos don't need it
 	    try_files            $uri $uri/ =404;
 	}
-
+	
 }