Nginx 常用配置模板
user root root; worker_processes auto;
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 1024m; add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS; 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]\."; server_tokens off;
access_log off; include vhost/*.conf;
}
server
{
listen 80;
#listen [::]:80;
server_name homework.wfkids.net;
return 301 https://$server_name$request_uri; access_log logs/homework80.log;
}
server
{
listen 443;
#listen [::]:80;
server_name homework.wfkids.net;
index index.html index.htm index.php default.html default.htm default.php;
root /home/static/pages/homework.wfkids.net; #error_page 404 /404.html; #location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
#{
# expires 30d;
#} #location ~ .*\.(js|css)?$
#{
# expires 12h;
#} location ~ /\.
{
deny all;
} location /course
{
proxy_pass http://homework.wfkids.net/course;
} access_log logs/homework443.log;
}
server
{
listen 80;
#listen [::]:80;
server_name 1111.wfkids.net;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/1111.wfkids.net; include none.conf;
#error_page 404 /404.html;
include enable-php.conf; #location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
#{
# expires 30d;
#} #location ~ .*\.(js|css)?$
#{
# expires 12h;
#} location ~ /\.
{
deny all;
} location /wfcm-api
{
proxy_pass http://wfnx.wfkids.net/wfcm-api;
} location /record
{
proxy_pass http://release.console.wf.pcein.com:28080/record;
}
location /mmopen{
proxy_pass http://thirdwx.qlogo.cn/mmopen;
}
access_log off;
}
server
{
listen 443;
#listen [::]:80;
server_name 1111.wfkids.net;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/1111.wfkids.net; include none.conf;
#error_page 404 /404.html;
include enable-php.conf; #location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
#{
# expires 30d;
#} #location ~ .*\.(js|css)?$
#{
# expires 12h;
#} location ~ /\.
{
deny all;
} location /wfcm-api
{
proxy_pass http://wfnx.wfkids.net/wfcm-api/;
} location /record
{
proxy_pass http://release.console.wf.pcein.com:28080/record;
}
location /mmopen{
proxy_pass http://thirdwx.qlogo.cn/mmopen;
}
access_log off;
}
Nginx 常用配置模板的更多相关文章
- 【第六课】Nginx常用配置下详解
目录 Nginx常用配置下详解 1.Nginx虚拟主机 2.部署wordpress开源博客 3.部署discuz开源论坛 4.域名重定向 5.Nginx用户认证 6.Nginx访问日志配置 7.Ngi ...
- 轻量级HTTP服务器Nginx(常用配置实例)
轻量级HTTP服务器Nginx(常用配置实例) 文章来源于南非蚂蚁 Nginx作为一个HTTP服务器,在功能实现方面和性能方面都表现得非常卓越,完全可以与Apache相媲美,几乎可以实现Apa ...
- Nginx常用配置实例(4)
Nginx作为一个HTTP服务器,在功能实现方面和性能方面都表现得非常卓越,完全可以与Apache相媲美,几乎可以实现Apache的所有功能,下面就介绍一些Nginx常用的配置实例,具体包含虚拟主机配 ...
- nginx常用配置
nginx.conf配置文件详解 其主要分为几个模块 全局快 从开始到events块之间的一部分内容,其作用域为全局作用域 events块 主要负责Nginx服务器与用户的网络连接 常用设置: 是否开 ...
- nginx常用配置2
## 一.Nginx中虚拟主机配置 ### 1.基于域名的虚拟主机配置 1.修改宿主机的hosts文件(系统盘/windows/system32/driver/etc/HOSTS) linux : ...
- Nginx 常用配置方式说明
原文内容来自于LZ(楼主)的印象笔记,如出现排版异常或图片丢失等问题,可查看当前链接:https://app.yinxiang.com/shard/s17/nl/19391737/7619763f-1 ...
- 第十章 nginx常用配置介绍
一.虚拟主机 1.配置方式 #虚拟主机配置方式:1.基于多IP的方式2.基于多端口的方式3.基于多域名的方式 2.方式一:基于多IP的方式 1.第一个配置文件[root@web02 /etc/ngin ...
- nginx常用配置系列-HTTPS配置
接上篇,nginx配置系列 HTTPS现在已经很流行,特别是AppStore上线的应用要求使用HTTPS进行通信,出于安全考虑也应该使用HTTPS,HTTPS配置需要准备证书文件,现在也有很多免费证书 ...
- nginx常用配置系列-虚拟主机
本来准备详尽的出一份nginx配置讲解,但nginx功能配置繁多,平常使用中使用最多的一般有: 1. 虚拟主机配置 2. HTTPS配置 3. 静态资源处理 4. 反向代理 ============= ...
随机推荐
- Python-selenium 下拉框定位
1.通过select 进行定位下拉框 首先selenium 很人性化的给提供了一个Select的模块,供处理下来菜单,首先我们需要导入Select,通过from selenium.webdriver. ...
- Python Parameter Passing Note
我刚刚开始学习Python, Python中的参数传递总是让我很困惑.我写了4个简单的Demo,帮助我理解Python的参数传递,希望对大家都能有所帮助. 0: def change(x): x = ...
- HTTP状态码集
1xx消息 这一类型的状态码,代表请求已被接受,需要继续处理.这类响应是临时响应,只包含状态行和某些可选的响应头信息,并以空行结束.由于HTTP/1.0协议中没有定义任何1xx状态码,所以除非在某些试 ...
- Delphi 正则表达式之TPerlRegEx 类的属性与方法(4): Replace
Delphi 正则表达式之TPerlRegEx 类的属性与方法(4): Replace // Replace var reg: TPerlRegEx; begin reg := TPerlRe ...
- httpmessageconverter requestbody responsebody
@ResponseBody @RequestMapping("/testHttpMessageConverter") public String testHttpMessageCo ...
- C/C++中0xcccccccc...
* 0xABABABAB : Used by Microsoft's HeapAlloc() to mark "no man's land" guard bytes after a ...
- 给JSP应用提供JSTL支持(IntelliJ IDEA)
===========手动分割线===2018-12-26============================================= Maven项目直接添加如下依赖即可: <de ...
- 【Java Web】新手教程(转)
转自:http://www.journaldev.com/1854/java-web-application-tutorial-for-beginners#web-server-client Web ...
- Python学习笔记之Python的enumerate函数
Python 的 enumerate() 函数就像是一个神秘的黑箱,你无法简单地用一句话来概括这个函数的作用与用法. enumerate() 函数属于非常有用的高级用法,而对于这一点,很多初学者甚至中 ...
- Java:正则表达式
Java:正则表达式 package com.fsti.icop.util.regexp; import java.util.regex.Matcher; import java.util.regex ...