nginx configuration to run thinkphp with nginx

location / {
index index.htm index.html index.php; #If
the file does not exist try TP parsing
try_files $uri /index.php$uri;
}

location ~ .+\.php($|/) {
fastcgi_pass unix:/dev/shm/php-fcgi.sock;
fastcgi_index index.php;

#Set PATH_INFO, note that fastcgi_split_path_info has automatically rewritten the fastcgi_script_name variable, #There
is no need to rewrite the SCRIPT_FILENAME, SCRIPT_NAME environment variables later, so you must set fastcgi_split_path_info before loading fastcgi.conf
^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;

#Load Nginx default "server environment variable" configuration
include fastcgi.conf;
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324842818&siteId=291194637