error_log  /home/wwwlogs/nginx_error.log  crit;

pid        /usr/local/nginx/logs/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile ; events
{
use epoll;
worker_connections ;
} http
{
include mime.types;
default_type application/octet-stream; server_names_hash_bucket_size ;
client_header_buffer_size 32k;
large_client_header_buffers 32k;
client_max_body_size 50m; sendfile on;
tcp_nopush on; keepalive_timeout ; tcp_nodelay on; fastcgi_connect_timeout ;
fastcgi_send_timeout ;
fastcgi_read_timeout ;
fastcgi_buffer_size 64k;
fastcgi_buffers 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k; gzip on;
gzip_min_length 1k;
gzip_buffers 16k;
gzip_http_version 1.0;
gzip_comp_level ;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\."; #limit_zone crawler $binary_remote_addr 10m; server_tokens off;
#log format
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for'; server
{
listen ;
server_name localhost;
index index.php index.html index.htm; if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$;
} location ~ .php {
root /usr/local/nginx/html/;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
include fastcgi_params;
#pathinfo support
set $real_script_name $fastcgi_script_name;
set $path_info '';
if ( $fastcgi_script_name ~ "^(.+?.php)(/.+)$"){
set $real_script_name $;
set $path_info $;
}
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
} location /status {
stub_status on;
access_log off;
} location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
} location ~ .*\.(js|css)?$
{
expires 12h;
} access_log /home/wwwlogs/access.log access;
}
include vhost/*.conf;
}

nginx.conf配置(支持thinkphp)的更多相关文章

  1. nginx的开机自启、server命令启动、nginx.conf配置

    1.将Nginx设置为开机自动启动 a.当上面6步完成之后,说明安装已经完全成功了,但是每次开机我们面临的一个问题,就是每次都要执行命令(1: cd /usr/local/nginx/sbin/   ...

  2. linux下Nginx配置文件(nginx.conf)配置设置详解(windows用phpstudy集成)

    linux备份nginx.conf文件举例: cp /usr/local/nginx/nginx.conf /usr/local/nginx/nginx.conf-20171111(日期) 在进程列表 ...

  3. nginx简单的nginx.conf配置

    nginx.conf配置如下: #user nobody;worker_processes 1; #error_log logs/error.log;#error_log logs/error.log ...

  4. linux系统下nginx安装目录和nginx.conf配置文件目录

    linux系统下nginx安装目录和nginx.conf配置文件目录 1.查看nginx安装目录 输入命令 # ps  -ef | grep nginx 返回结果包含安装目录 root      26 ...

  5. nginx.conf 配置解析之文件结构

    nginx.conf配置文件结构如下: ...... #主要定义nginx的全局配置 events{ #events(事件)块:主要配置网络连接相关 } http{ #http块:代理缓存和日志定义绝 ...

  6. lnmp配置支持thinkphp和nginx路由url重写

    ThinkPHP3.2.3项目放到lnmp环境之后只能打开首页,或者通过传参方式打开控制器,否则就一直显示404页面.搞了一上午,终于解决了 step1: 修改php.ini cgi.fix_path ...

  7. Nginx 开启PATHINFO支持ThinkPHP框架实例

    ThinkPHP支持通过PATHINFO和URL rewrite的方式来提供友好的URL,只需要在配置文件中设置 'URL_MODEL' => 2 即可.在Apache下只需要开启mod_rew ...

  8. nginx.conf配置

    在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集与网络. #运行用户 user www-data; #启动进程,通常设置成和cpu的数量相等 worker_processe ...

  9. Nginx 之二: nginx.conf 配置及基本优化

    一:常用功能优化: 1:网络连接的优化: 只能在events模块设置,用于防止在同一一个时刻只有一个请求的情况下,出现多个睡眠进程会被唤醒但只能有一个进程可获得请求的尴尬,如果不优化,在多进程的ngi ...

  10. nginx虚拟机配置(支持php)

    由于本人水平有限,以下记录仅作参考. 下面贴出我的一份正常运行的nginx服务器虚拟机配置./usr/local/nginx/conf/vhost/www.xsll.com.conf server { ...

随机推荐

  1. [刘阳Java]_MyBatis_映射文件的resultMap标签入门_第4讲

    <resultMap>:用于解决实体类中属性和表字段名不相同的问题 id:表示当前<resultMap>标签的唯一标识 result:定义表字段和实体类属性的对应关系 prop ...

  2. 【私人定制jackson】定制jackson的自定义序列化(null值的处理)

    最近用springMVC做服务端的http+json的接口,出现一个不是特别容易解决的问题: 在对List类型的值进行处理时,有一部分服务是有做一些逻辑判断的,在逻辑判断不通过的时候会返回一个null ...

  3. pynotify

    import pynotify,sys if not pynotify.init('a'): sys.exit(1) n=pynotify.Notification('title','info','f ...

  4. NC JDK报tools.jar错误(61版本)

    添加jdk/lib目录下的tools.jar 然后设置环境变量

  5. wget下载工具

    转自于:http://www.jb51.net/LINUXjishu/86326.html 1.使用wget下载单个文件  e.g. wget http://cn.wordpress.org/word ...

  6. 《笨办法学C》笔记之指针

    C语言编程主要操作的对象就是指针. 指针从哪里来 指针就是表示内存存储区域的一组数值,使用%p格式化字符串. Linux系统会为程序维护两个临时变量存储位置:栈.堆.栈的空间少,栈通常在用户更高的地址 ...

  7. cut笔记

    cut -f 2,3 file.txt                                #查看第2.3列的信息,列分隔符默认为空格符 指定分隔符使用-d选项,如: cut -f 2,3 ...

  8. SAAS在中国市场的发展前景

    发展现状 2008年1-7月软件行业实现收入4199.1亿元,同比增长32.4%.2008年第一季度,业务管理软件市场总量达16.31亿元,同比增长17.8%.面对成本的上升,企业选择了向信息化要效率 ...

  9. R与Java

    对于从未接触代码的我,看到这些很陌生,现在需要做的是用r语言去做数据处理分析,将分析的结果给Java,然后在Java上输出想要的结果,没人给予指导,自己就这样瞎摸索,真希望有这方面的牛人给予指导,让一 ...

  10. css js 的引入方式和书写位置

    css 的引入方式 1.行内样式 <div id="div1" style="width:100px; height:100px; background:red&q ...