location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
nginx里配的是: fastcgi_pass 127.0.0.1:9000; //tcp socket模式
找到/etc/php/7.0/fpm/pool.d/www.conf文件,php-fpm里相应的 listen = /run/php-fpm/www.sock
改成: listen = 127.0.0.1:9000 或者直接 listen = 9000,
server {
listen 80;
server_name askmetest.yunpintech.com ;
location / {
add_header 'Access-Control-Allow-Origin' '*';
proxy_pass http://127.0.0.1:8080;
}
}
stemcell@iZwz9d60kweaefxsls6od5Z:/etc/nginx/sites-enabled$ cat 8093.conf
server {
listen 8093;
server_name www.example.com;
index index.html index.htm index.php;
root /home/stemcell/data/MedicalDiagnosisCRM/end;
location / {
index index.htm index.html index.php;
#访问路径的文件不存在则重写URL转交给ThinkPHP处理
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
}
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 7d;
access_log off;
}
location ~ .*\.(js|css)?$ {
expires 1d;
access_log off;
}
}