---
title: "nginx + php-fpm 服务器配置"
author: "Nonkr"
date: "2013-10-30T14:23:24Z"
tags: []
categories: ["Web前端"]
slug: "nginx-php-fpm"
draft: false
lastmod: "2013-10-30T14:23:24Z"
id: 1966811
url: "https://nonkr.iteye.com/blog/1966811"
---

增加.htm格式的文件解析为php

 

修改nginx.conf，在server{}内，添加

 

location ~ \\.php|\\.htm$ {

root           /home/www;

fastcgi\_pass   127.0.0.1:9000;

fastcgi\_index  index.php;

fastcgi\_param  SCRIPT\_FILENAME  $document\_root$fastcgi\_script\_name;

include        fastcgi\_params;

}

 

修改/etc/php-fpm.d/www.conf

security.limit\_extensions = .php .php3 .php4 .php5 .htm