diff --git a/conf/nginx.conf b/conf/nginx.conf index fd65f72..9325dd3 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,7 +1,3 @@ -# try redirecting stuff to index.php -rewrite ^(.*)$ /index.php$1 last; -root __INSTALL_DIR__/public/; - location / { alias __INSTALL_DIR__/public/; @@ -12,6 +8,8 @@ location / { try_files $uri $uri/ /index.php?$query_string; location ~ [^/]\.php(/|$) { + # try redirecting stuff to index.php + rewrite ^(.*)$ /index.php$1 last; fastcgi_split_path_info ^(.+\.php)(/.+)$; #fastcgi_pass unix:/var/run/php/php__PHP_VERSION__-fpm-__APP__.sock; fastcgi_pass unix:/var/run/php/php__PHP_VERSION__-fpm.sock; @@ -28,5 +26,6 @@ location / { } # not tested; it may have trouble redirecting location /api/ { + alias __INSTALL_DIR__/public/; try_files $uri $uri/ /api/index.php?$query_string; }