15
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Nginx で PHP Slim Framework を動かす設定

Posted at
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;
15
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?