以.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; } ...
security.limit_extensions = .php .php3 .php4 .5 py 以上就介紹了nginx+php之任意類型(.py)解釋為php配置方式,包含了方面的內容,希望對PHP教程有興趣的朋友有所幫助。