Home >Backend Development >PHP Tutorial >Any type (.py) of nginx+php is interpreted as PHP configuration method

Any type (.py) of nginx+php is interpreted as PHP configuration method

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-08-08 09:27:151104browse

Take the .py file as an example

1. Configure location in ngxin.conf

...
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. Modify the php-fpm.conf configuration file

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

The above introduces the interpretation of any type (.py) of nginx+php as PHP configuration method, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn