1

構成 nginx php5-fpm (domain.com を変更)

server {
  listen 80 default;
  server_name domain.com;

  root /var/www/domain.com;
  access_log /var/log/nginx/domain.com.access_log;
  error_log /var/log/nginx/domain.com.error_log;
   index index.php;

   try_files $uri @rewrite;

  location @rewrite {
    rewrite ^/(.*)$ /index.php/$1;
  }   
  location ~ \.php {
   fastcgi_index index.php;
   fastcgi_pass 127.0.0.1:9000;
   include fastcgi_params;
   fastcgi_split_path_info ^(.+\.php)(/.+)$;
   fastcgi_param PATH_INFO $fastcgi_path_info;
   fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
   fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  }

  location ~ /\.ht {
    deny all;
  }
}

このコードはルート パスでは機能しません...

例:

domain.com/parse/a/b --> 動作 domain.com/parse --> 動作

domain.com --> 機能していません

4

1 に答える 1