nginx 支持php頁面配置
默認配置文件
[root@tg01 conf.d]# cat tg-t2.conf
root@tg01 conf.d]# cat tg-t2.conf
server {
{
listen 8098;
listen 8098;
server_name localhost;
server_name localhost;
location / {
location / {
root /opt/nginx/tg-t2;
root /opt/nginx/tg-t2;
index index.php index.htm index.html;
index index.php index.htm index.html;
}
location ~\.php$ {
location ~\.php$ {
root /opt/nginx/tg-t2;
root /opt/nginx/tg-t2;
fastcgi_pass 127.0.0.1:9000;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /opt/nginx/tg-t2$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /opt/nginx/tg-t2$fastcgi_script_name;
include fastcgi_params;
include fastcgi_params;
}
}