[nginx] Use try_files instead of if for /.well-known/.
authorAndreas Neustifter <andreas.neustifter@gmail.com>
Thu, 28 Jun 2018 04:43:33 +0000 (04:43 +0000)
committerAndreas Neustifter <andreas.neustifter@gmail.com>
Mon, 9 Jul 2018 10:42:32 +0000 (12:42 +0200)
See https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/

mods/sample-nginx.config

index a3e4611..0c54438 100644 (file)
@@ -93,9 +93,7 @@ server {
   # by denying dot files and rewrite request to the front controller
   location ^~ /.well-known/ {
     allow all;
-   if (!-e $request_filename) {
-     rewrite ^(.*)$ /index.php?pagename=$1;
-   }
+    try_files $uri /index.php?pagename=$uri&$args;
   }
 
   include mime.types;