nginx.conf配置(支持thinkphp)
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)的更多相关文章
- nginx的开机自启、server命令启动、nginx.conf配置
1.将Nginx设置为开机自动启动 a.当上面6步完成之后,说明安装已经完全成功了,但是每次开机我们面临的一个问题,就是每次都要执行命令(1: cd /usr/local/nginx/sbin/ ...
- linux下Nginx配置文件(nginx.conf)配置设置详解(windows用phpstudy集成)
linux备份nginx.conf文件举例: cp /usr/local/nginx/nginx.conf /usr/local/nginx/nginx.conf-20171111(日期) 在进程列表 ...
- nginx简单的nginx.conf配置
nginx.conf配置如下: #user nobody;worker_processes 1; #error_log logs/error.log;#error_log logs/error.log ...
- linux系统下nginx安装目录和nginx.conf配置文件目录
linux系统下nginx安装目录和nginx.conf配置文件目录 1.查看nginx安装目录 输入命令 # ps -ef | grep nginx 返回结果包含安装目录 root 26 ...
- nginx.conf 配置解析之文件结构
nginx.conf配置文件结构如下: ...... #主要定义nginx的全局配置 events{ #events(事件)块:主要配置网络连接相关 } http{ #http块:代理缓存和日志定义绝 ...
- lnmp配置支持thinkphp和nginx路由url重写
ThinkPHP3.2.3项目放到lnmp环境之后只能打开首页,或者通过传参方式打开控制器,否则就一直显示404页面.搞了一上午,终于解决了 step1: 修改php.ini cgi.fix_path ...
- Nginx 开启PATHINFO支持ThinkPHP框架实例
ThinkPHP支持通过PATHINFO和URL rewrite的方式来提供友好的URL,只需要在配置文件中设置 'URL_MODEL' => 2 即可.在Apache下只需要开启mod_rew ...
- nginx.conf配置
在此记录下Nginx服务器nginx.conf的配置文件说明, 部分注释收集与网络. #运行用户 user www-data; #启动进程,通常设置成和cpu的数量相等 worker_processe ...
- Nginx 之二: nginx.conf 配置及基本优化
一:常用功能优化: 1:网络连接的优化: 只能在events模块设置,用于防止在同一一个时刻只有一个请求的情况下,出现多个睡眠进程会被唤醒但只能有一个进程可获得请求的尴尬,如果不优化,在多进程的ngi ...
- nginx虚拟机配置(支持php)
由于本人水平有限,以下记录仅作参考. 下面贴出我的一份正常运行的nginx服务器虚拟机配置./usr/local/nginx/conf/vhost/www.xsll.com.conf server { ...
随机推荐
- 用SQLMAP工具进行SQL注入
1.检查注入点 [注入点需要自己寻找,可以利用一些工具,例如:Acunetix Web Vulnerability scanner (WVS),AppScan等]u表示URL. sqlmap - ...
- ASI 与 AFN
HTTP终结者.功能十分强大. 基于底层的CFNetwork框架,运行效率很高. 可惜
- VBA用户控件
窗体相关 1.显示窗体 UserForm1.show [vbModeless] vbModeless 可选参数,参数设定后,变成无模式窗体.窗体保持显示状态,仍可操作Excel文件. UserFor ...
- MFC字符串转化成16进制
//CString m_str = _T("11"); //USES_CONVERSION; //char *m_cc = T2A(m_str); //BYTE m_bb; //s ...
- windows下mongodb权限设置解决方法
mongodb简介: MongoDB 是一个跨平台的,面向文档的数据库,提供高性能,高可用性和可扩展性方便. MongoDB工作在收集和文件的概念. MongoDB默认设置为无权限访问限制,所以可以直 ...
- java学习教程
java依然是目前比较流行的语言.虽然,本人是C#开发者,但是由于公司决定使用java开发,所以只好开始学习java.在学校时候只是接触过没有过深的学习过,而且参加工作后基本也一直在搞C#.好在,现在 ...
- 手机GPS为什么能在室内定位?
为什么手机在室内也能定位?大部分人知道手机会通过GPS进行定位,其实手机定位系统并不是和我们的RTK完全一样的,因为那样就无法解释为何在室内也能定位了,这里我来科普一下智能手机的那些定位方法. ...
- Rails中用CSV导出中文真心有技巧
require 'csv' class PartRequestsController < ApplicationController def render_csv_header(filename ...
- System.Security.SecurityException The source was not found, but some or all event logs could not be searched.Inaccessible logs Security.
An exception occurred during the Install phase. System.Security.SecurityException The source was not ...
- switch的经典引用
#include<stdio.h> int main(void) { int i; do{ printf("按1,流量查询\n"); printf("按2,人 ...