Nginx Rewrite working except for root directory -
I would like to pass all requests that do not match on a file from // localhost . This is my Nginx configuration: PS: Only today the NGX coming from the upgrade has been started. OUO found / framework / root
/ for all requests except for example
http: //
server {80 says; Root / var / www / html; Server_name localhost; Location / {try_files $ uri $ uri / @ root; } Place @ Route {rewrite ^ (. *) $ / Framework / root.php? Path = $ 1; } # 127.0.0.1:9000 To pass the PHP scripts to the FastCGI server at the place ~ \ .php $ {try_files $ uri = 404; Fastcgi_pass Unix: /var/run/php5-fpm.sock; Fastcgi_index index.php; Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name; Includes fastcgi_params; } # .htaccess denies access to files, if Apache's documentation is related to a # location of route # NGN ~ ~ / ..ht {reject all; }}
try_files $ Uri $ uri / @root; should be
try_files $ uri @root; without
$ uri / part because it matches the base
/ directory.
Comments
Post a Comment