nginx.conf文件
user www www;
worker_processes auto;
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 51200;
events
{
use epoll;
worker_connections 51200;
multi_accept on;
}
http
{
include
mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
gzip on;
gzip_min_length 1k;
gzip_buffers
4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types
text/plain application/javascript application/x-javascript
text/javascript text/css application/xml application/xml+rss;
gzip_vary on;
gzip_proxied expired no-cache
no-store private auth;
gzip_disable "MSIE
[1-6]\.";
#limit_conn_zone $binary_remote_addr zone=perip:10m;
##If enable limit_conn_zone,add "limit_conn perip 10;" to server
section.
server_tokens off;
access_log off;
server
{
listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
server_name _;
index index.html index.htm index.php;
root /home/wwwroot/default;
#error_page
404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ {
deny all; }
include enable-php.conf;
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires
30d;
}
location ~ .*\.(js|css)?$
{
expires
12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
if (!-e
$request_filename) {
rewrite ^(.*)$
/index.php?s=/$1 last;
break;
}
access_log /home/wwwlogs/access.log;
}
include vhost/*.conf;
}
nginx.conf文件的更多相关文章
- 借用nginx.vim工具进行语法高亮和格式化配置nginx.conf文件
在生产环境中,我们肯定经常用到nginx.conf文件的编排工作,今天在阅读<决战nginx>的时候无意间看到nginx.vim这个辅助工具,于是百度搜索和实际部署检测了一下,其效果确实让 ...
- 虚拟主机ip配置,nginx.conf文件配置及日志文件切割
今天粗略整理了一下虚拟主机配置,nginx.conf文件的配置,及日志文件的切割,记录如下: nginx虚拟主机配置:1.IP地址配置,2.绑定ip地址和虚拟主机详情:1.ip地址的配置:ifconf ...
- Dockerfile + Nginx.conf文件记录(用于前端项目部署)
Dockerfile + Nginx.conf文件记录(用于前端项目部署) 本教程依据个人理解并经过实际验证为正确,特此记录下来,权当笔记. 注:基于linux操作系统(敏感信息都进行了处理),默认服 ...
- 在k8s中将nginx.conf文件内容创建为ConfigMap挂载到pod容器中
将nginx.conf文件内容创建为ConfigMap user nginx; worker_processes auto; error_log /var/log/nginx/error.log er ...
- docker+nginx搭建tomcat集群(附录)——nginx.conf文件
附录:nginx.conf修改后的文件内容 user root;worker_processes 2; #error_log logs/error.log;#error_log logs/error. ...
- nginx conf 文件
server { listen ; server_name local.light.com; index index.html index.htm index.php; root /home/wwwr ...
- 详解nginx.conf文件配置项(包括负载均衡)
http://www.cnblogs.com/hsapphire/archive/2010/04/08/1707109.html #运行用户 user nobody nobody; #启动进程 wo ...
- nginx.conf文件说明
#Nginx所有用户和组,window下不指定 #user nobody; #工作的子进程数量(通常等于CPU数量或者2倍于CPU) worker_processes 1; #错误日志存放路径 #er ...
- nginx.conf文件配置明细详解
#etnx运行的用户和用户组 user nginx nginx; #工作进程数,建议设置为CPU的总核数 worker_processes ; #全局错误日志定义类型,日志等级从低到高依次为: #de ...
随机推荐
- .bashrc:16: command not found: shopt配置环境变量时出错
source .bashrc ------------------------------------------------------- .bashrc:: command not found: ...
- ThreadLocal从源码到应用
最早接触到ThreadLocal是在阅读dianping的Cat-client,当时对它不是很理解,就搜索了一下,大概了解是一种解决线程安全问题的机制.现在再次阅读<实战java高并发程序设计& ...
- linux 下安装 sphinx 服务器
准备工作:安装需要的扩展文件 yum install make gcc g++ gcc-c++ libtool autoconf automake imake libxml2-devel expat- ...
- C# 控件拖动
https://zhidao.baidu.com/question/2116834779399609987.html [DllImport("user32.dll", EntryP ...
- Java学习笔记15---instanceof与向下转型
感冒咳嗽停更了几天,今天恢复更新了. 先来看下instanceof与向下转型的概念: 1.instanceof instanceof是一个二元操作符,用法是:boolean result = a in ...
- Android 根据字符串动态获取资源ID
1.常用方法public int getResId(String name,Context context){ Resources r = context.getResources(); int id ...
- Java学习笔记6(循环和数组练习题)
1.输出100到1000的水仙花数: public class LoopTest{ public static void main(String[] args){ int bai = 0; int s ...
- Nginx配置反向代理
Nginx可做web服务器,也可做负载均衡使用. 反向代理:应用服务器不直接提供服务,通过nginx服务器处理请求, 转发到代理服务器(Tomcat,Nginx,Apache等) 获取响应交给客户端, ...
- main函数是主线程吗
1.线程的概念: 线程是程序最基本的运行单位,而进程不能运行,所以能运行的,是进程中的线程. 2.线程是如何创建起来的: 进程仅仅是一个容器,包含了线程运行中所需要的数据结构等信息.一个进程创建时,操 ...
- 关于FPGA的一些你必须知道的概念
前仿真也称为功能仿真,主旨在于验证电路的功能是否符合设计要求,其特点是不考虑电路门延迟与线延迟,主要是验证电路与理想情况是否一致.可综合FPGA代码是用RTL级代码语言描述的,其输入为RTL级代码与T ...