nginx解析php

  • nginx解析php

server {    

    listen 80;    

    server_name localhost;    

    index index.html index.htm index.php;    

     root /opt/nginx/html;

    location /{        

         root /opt/nginx/html;    

   }

   location ~ .*.(php|php5)?$ {      

        include fastcgi.conf;  

       #fastcgi.conf 有一行fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;        

       #fastcgi_pass unix:/tmp/www.sock;        

       fastcgi_pass 127.0.0.1:12091;        

       fastcgi_index index.php;

    }

}

原文地址:https://www.cnblogs.com/hanxiaohui/p/8487647.html