upstream fastcgi_backend {
server 127.0.0.1:9000; # 9000ポートで受ける
}
server {
listen 192.168.33.10:8000;
root /var/www/project_name/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_pass fastcgi_backend; # 上記upstreamに流す
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_connect_timeout 3s; # default of 60s is just too long
fastcgi_read_timeout 10s; # default of 60s is just too long
}
}
参考 :
https://github.com/codeguy/Slim
基本的に、これ書いときゃいいらしい。
try_files $uri $uri/ /index.php?$args;