Skip to main content
Github

Nginx

Learn how to configure Inphinit on nginx servers.

Configuring Nginx

To configure the nginx web server, you can use the following example to configure your nginx.conf:

location / { root /home/foo/bar/my-application/public; # Redirect page errors to route system error_page 403 /index.php; error_page 500 /index.php; # Ignore hidden files: ^\.|/\. location ~ /\. { rewrite ^ /index.php last; } # Redirect all urls to index.php if no exists files location / { try_files $uri /index.php$is_args$args; } location ~ \.php$ { # Replace with your FPM or FastCGI address fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }