]> git.mxchange.org Git - friendica.git/commitdiff
[nginx] Use try_file instead of if.
authorAndreas Neustifter <andreas.neustifter@gmail.com>
Thu, 28 Jun 2018 19:15:06 +0000 (19:15 +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/tutorials/config_pitfalls/?utm_source=tool.lu#check-if-file-exists.

mods/sample-nginx.config

index 0c5443828c344e1f3580e6b50a86089f782062a5..e4ce902515e4c858bc2ff09da3e81c1dd2f11af3 100644 (file)
@@ -84,9 +84,7 @@ server {
 
   # rewrite to front controller as default rule
   location / {
-    if (!-e $request_filename) {
-      rewrite ^(.*)$ /index.php?pagename=$1;
-    }
+    try_file $uri /index.php?pagename=$uri&$args;
   }
 
   # make sure webfinger and other well known services aren't blocked