LoginSignup
12
10

More than 5 years have passed since last update.

cakephp3 + nginxで、さくらVPSの設定conf

Last updated at Posted at 2015-12-10

CakePHP3とNginxの設定で苦労したので、覚え書きです。

/etc/nginx/conf.d/virtual.conf
server {
    listen       80;
    server_name   example.com www.example.com;

    root   /var/www/example.com/webroot;
    index  index.php index.html;

    location / {
        try_files $uri $uri?$args $uri/ /index.php?$uri&$args /index.php?$args; 
    }
    location ~ \.php$ {
    include /etc/nginx/fastcgi_params;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param CAKE_ENV "production";
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
   }
}
12
10
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
12
10