NGINX
Learn how to create a new Inphinit project.
If you want to experiment with a web server such as NGINX, you can use the following example to configure your nginx.conf:
location / {
root /home/foo/bar/my-application;
# Redirect page errors to route system
error_page 403 /index.php/RESERVED.INPHINIT-403.html;
error_page 500 /index.php/RESERVED.INPHINIT-500.html;
try_files /public$uri /index.php?$query_string;
location = / {
try_files $uri /index.php?$query_string;
}
location ~ /\. {
try_files /index.php$uri /index.php?$query_string;
}
location ~ \.php$ {
# Replace by your FPM or FastCGI
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
set $inphinit_prefix "";
if ($uri != "/index.php") {
set $inphinit_prefix "/public";
}
fastcgi_param SCRIPT_FILENAME $realpath_root$inphinit_prefix$fastcgi_script_name;
}
}