配置nginx支持PHP

server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm index.php;   #这里添加一个index.php
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {                      #这里去掉#
        #    fastcgi_pass   http://127.0.0.1:9000;       #这里去掉#
root html;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME html$fastcgi_script_name;
include fastcgi_params;

#} #这里去掉#

 

posted @ 2021-09-08 09:29  拥抱大海,面向天空  阅读(562)  评论(0)    收藏  举报