nginx+php之任意类型(.py)解释为php配置方式

来源:互联网 发布:淘宝固定背景尺寸 编辑:程序博客网 时间:2024/06/01 07:48

以.py文件为例

1.在ngxin.conf配置location

...server {    listen       80 default;    server_name  _;        index index.html index.htm index.php;        root /alidata/www/default;        <span style="color:#ff0000;">location ~ .*\.(php|php5|py)?$</span>        {                fastcgi_pass  127.0.0.1:9000;                fastcgi_index index.php;                include fastcgi.conf;        }        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$        {                expires 30d;        }        location ~ .*\.(js|css)?$        {                expires 1h;        }        access_log  /alidata/log/nginx/access/default.log;}...

2.修改php-fpm.conf配置文件

security.limit_extensions = .php .php3 .php4 .php5 .py


0 0
原创粉丝点击