nginx的server块如何支持php

直接贴代码,备份用

server
{
    listen 80;
    server_name abc.com;
    index index.html index.htm index.php;
    root /var/www;

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }

需要在每一个希望支持php的server块当中插入以上location代码。

posted @ 2018-03-02 09:26  忙碌在路上  阅读(259)  评论(0编辑  收藏  举报