server {
listen 8000;
server_name default;
# This is the folder that index.php is in
root /var/www/default/public;
index index.php index.html index.htm;
charset utf-8;
client_max_body_size 100M;
fastcgi_read_timeout 1800;
# Represents the root of the domain
# http://localhost:8000/[index.php]
location / {
# Important ***
# Matches URLS `$_GET['_url']`
try_files $uri $uri/ /index.php?_url=$uri&$args;
}
# When the HTTP request does not match the above
# and the file ends in .php
location ~ [^/]\.php(/|$) {
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index /index.php;
include fastcgi_params;
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
access_log off;
}
}
php -S localhost:8200 .htrouter.php