Nginx PHP-FPM增加PHP后缀解析
2016-08-04 11:22
260 查看
在很多情况下,我们需要把.html也使用php解析。更改nginx配置文件
location ~ \.(php|do|aspx)?$ { #这里增加后缀 fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }这个时候访问这些后缀的时候会报403错误,原因是php-fpm限制了后缀的解析
2016/08/04 11:03:35 [error] 6225#0: *65 FastCGI sent in stderr: "Access to the script '/var/www/html/index.aspx' has been denied (see security.limit_extensions)" while reading response header from upstream, client: 127.0.0.1, server: www.abc.com, request: "HEAD /index.aspx HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1"更改php-fpm.conf配置文件
security.limit_extensions = .php .aspx .do重启php-fpm服务即可
相关文章推荐
- 烂泥:nginx、php-fpm、mysql用户权限解析
- php fpm nginx解析
- nginx用php-fpm解析php文件实现文件上传
- mac下nginx搭配php-fpm解析php文件
- nginx、php-fpm、mysql用户权限解析
- nginx、php-fpm、mysql用户权限解析
- centos 安装php-fpm , nginx二级域名配置 ,但为什么必须要 域名提供商 哪里解析新的二级域名一下 才能用呢?
- 配置Nginx来支持PHP----重点介绍Nginx如何通过PHP_FPM的FastCGI进程对PHP进行解析处理。
- 【转】PHP网站(nginx、php-fpm、mysql) 用户权限解析
- Nginx解析PHP的原理 | CGI、FastCGI及php-fpm的关系
- nginx、php-fpm、mysql用户权限解析
- nginx、php-fpm、mysql用户权限解析
- nginx、php-fpm、mysql用户权限解析
- 烂泥:nginx、php-fpm、mysql用户权限解析
- Nginx更改PHP解析后缀
- shell 之 lnmp(nginx-1.0.5+php-fpm5.3.6+mysql)安装脚本
- ubuntu 10.10 nginx+php+php-fpm+mysql简单搭建实现
- ubuntu 10.10 nginx+php+php-fpm+mysql简单搭建实现
- linux(centos)上配置nginx、mysql、php-fpm开机启动
- nginx_笔记分享_2_php-fpm详解