小编Has*_*san的帖子

在nginx和php上访问被拒绝

使用nginx web服务器和php.nginx正在工作,我看到'欢迎来到nginx!' 但在尝试访问php页面时,我得到"访问被拒绝".我还安装了php-fastcgi.

这是我的nginx默认conf:

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

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
#    proxy_pass   http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
    root   /usr/share/nginx/html;
    fastcgi_index  index.php;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    include fastcgi_params;
   # fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
    include        fastcgi_params; …
Run Code Online (Sandbox Code Playgroud)

php nginx

8
推荐指数
2
解决办法
3万
查看次数

标签 统计

nginx ×1

php ×1