其他大神的配置 nginx 配置参考

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

`

user nginx nginx; worker_processes 2;

#error_log logs/error.log; error_log logs/error.log notice; #error_log logs/error.log info;

pid logs/nginx.pid; google_perftools_profiles /tmp/tcmalloc; worker_rlimit_nofile 65535;

events { worker_connections 65535; use epoll; }

http { include mime.types; default_type application/octet-stream;

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_referer" ''"$http_user_agent" "$http_x_forwarded_for" "$request_time" "$request_body"';#access_log  logs/access.log  main;sendfile        on;
tcp_nopush      on;
tcp_nodelay     on;
server_tokens   off;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 30m;
client_body_buffer_size 1024k;#keepalive_timeout  0;
keepalive_timeout  65;
geoip_country /setup/nginx/conf/GeoIP.dat;
proxy_connect_timeout   60;
proxy_send_timeout      60;
proxy_read_timeout      60;
proxy_buffer_size       256k;
proxy_buffers           8 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;

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 128k;

 gzip on;gzip_min_length  5k;gzip_buffers     16 8k;gzip_http_version 1.1;gzip_comp_level 6;gzip_types application/javascript text/plain text/css text/js application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;gzip_vary on;gzip_proxied any; underscores_in_headers on;  upstream testd.skg.com {

server 10.24.167.199:8085 weight=100 max_fails=3 fail_timeout=30s; }

upstream testlogin.skg.com { server 10.24.167.199:8085 weight=100 max_fails=3 fail_timeout=30s; }

upstream testskg.skg.com { server 10.24.167.199:8085 weight=100 max_fails=3 fail_timeout=30s; }

upstream testo.skg.com { server 10.24.167.199:8089 weight=100 max_fails=3 fail_timeout=30s; }

upstream testwap.skg.com { server 10.24.167.199:8088 weight=100 max_fails=3 fail_timeout=30s; }

 server {listen       80;server_name  test.tatatoutiao.com;underscores_in_headers on;#charset koi8-r;access_log  logs/test.tatatoutiao.com.access.log  main;location / {index  index.html index.htm index.jsp;proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;proxy_pass http://10.24.167.199:8080;}}         server {listen       80;server_name  testwap.tatatoutiao.com;#charset koi8-r;access_log  logs/testwap.tatatoutiao.com.access.log  main;#location  / {#    root /setup/nginx/tata;#   index  index.htm index.html;#  access_log off;#        }location / {index  index.html index.htm index.jsp;proxy_pass http://10.24.167.199:8080;proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;}}

server { listen 80; server_name testapi.tatatoutiao.com ;

    #charset koi8-r;access_log  logs/testapi.tatatoutiao.com.access.log  main;location / {index  index.html index.htm index.jsp;proxy_pass http://10.24.167.199:8082;proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;}}

server { listen 80; server_name testadmin.tatatoutiao.com;

    #charset koi8-r;access_log  logs/testadmin.tatatoutiao.com.access.log  main;location / {index  index.html index.htm index.jsp;proxy_pass http://10.24.167.199:8083;proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;}}server {listen       80;server_name  lifetest.skg.com;underscores_in_headers on;#charset koi8-r;access_log  logs/lifetest.skg.com.access.log  main;location / {index  index.html index.htm index.jsp;proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;proxy_pass http://10.24.167.199:8080;}}         server {listen       80;server_name  lifetestwap.skg.com;#charset koi8-r;access_log  logs/lifetestwap.skg.com.access.log  main;#location  / {#    root /setup/nginx/tata;#   index  index.htm index.html;#  access_log off;#        }location  /bbswx/ {index  index.html index.htm index.jsp;proxy_pass   http://10.24.167.199:8080;proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;add_header From m.skg.com;proxy_cookie_path /bbswx/   /;proxy_set_header Cookie $http_cookie;}location  /styles/bbswx/ {index  index.html index.htm index.jsp; client_max_body_size    100m; proxy_pass   http://10.24.167.199:8080; proxy_set_header Host $host;         proxy_set_header X-Forward-For $remote_addr; proxy_set_header X-Real-IP $remote_addr; }location  /scripts/bbswx/ {index  index.html index.htm index.jsp; client_max_body_size    100m; proxy_pass   http://10.24.167.199:8080; proxy_set_header Host $host;         proxy_set_header X-Forward-For $remote_addr; proxy_set_header X-Real-IP $remote_addr; }location / {index  index.html index.htm index.jsp;proxy_pass http://10.24.167.199:8080;proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;}}

server { listen 80; server_name lifetestapi.skg.com ;

    #charset koi8-r;access_log  logs/lifetestapi.skg.com.access.log  main;location / {index  index.html index.htm index.jsp;proxy_pass http://10.24.167.199:8082;proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;}}

server { listen 80; server_name lifetestadmin.skg.com;

    #charset koi8-r;access_log  logs/lifetestadmin.skg.com.access.log  main;location / {index  index.html index.htm index.jsp;proxy_pass http://10.24.167.199:8083;proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;}}server {listen       80;server_name testskg.skg.com; #charset koi8-r;if ( $request_uri ~* ^/index\.htm$ ){rewrite  ^/index\.htm$   http://testskg.skg.com permanent;}       #登录页面验证码从后端动态获取location = /generateImage.html {proxy_pass http://testd.skg.com/generateImage.html;}#location ^~ /scripts/#  {#root /usr/local/nginx/html/;#access_log off;#   }#location ^~ /styles/#   {# root /usr/local/nginx/html/;# access_log off;#  }location = /category/ {root /usr/local/nginx/html/category;index  index.htm index.html category.html category.htm;access_log off;if  (!-e $request_filename) {proxy_pass   http://testskg.skg.com;}}location ~* \.(css|js)${root /usr/local/nginx/html/;access_log off;expires 1h;}location / {root /usr/local/nginx/html; index  index.htm index.html;if  (!-e $request_filename) {proxy_pass   http://testskg.skg.com;}}location /storefront/member/toLogin.html {rewrite . https://testlogin.skg.com/storefront/member/toLogin.html;}}#   location / {#     root   html;#     index  index.html index.htm index.jsp;#     client_max_body_size    100m;#     proxy_pass   http://testskg.skg.com;#     proxy_set_header Host $host;	#     proxy_set_header X-Forward-For $remote_addr;#     proxy_set_header X-Real-IP $remote_addr;#             }# }server {listen       80;server_name testwap.skg.com ; #charset koi8-r;#access_log  logs/host.access.log  main;#rewrite "^/product\/([0-9]{15}).htm/?$" http://testwap.skg.com/product/$1.html permanent;  
#rewrite "^/category\/([a-z-A-Z]+)_([a-z-A-Z]+).htm/?$" http://testwap.skg.com/category/$1_$2.html permanent;location  /bbswx/ {#root   html;#  index  index.html index.htm index.jsp;#  client_max_body_size    100m;#  proxy_pass   http://10.24.167.199:8080;#proxy_cookie_path /bbswx/ /;#proxy_set_header Cookie $http_cookie;#  proxy_set_header Host $host;	#  proxy_set_header X-Forward-For $remote_addr;# proxy_set_header X-Real-IP $remote_addr;if ($host ~* testwap.skg.com) {rewrite ^/(.*)$ http://lifetestwap.skg.com/$1 permanent;}}location  /styles/bbswx/ { #root   html; # index  index.html index.htm index.jsp; # client_max_body_size    100m; # proxy_pass   http://10.24.167.199:8080; # proxy_set_header Host $host;         # proxy_set_header X-Forward-For $remote_addr; # proxy_set_header X-Real-IP $remote_addr; if ($host ~* testwap.skg.com) {rewrite ^/(.*)$ http://lifetestwap.skg.com/$1 permanent;}} location  /scripts/bbswx/ { #root   html; #index  index.html index.htm index.jsp; #client_max_body_size    100m; #proxy_pass   http://10.24.167.199:8080; #proxy_set_header Host $host;         #proxy_set_header X-Forward-For $remote_addr; #proxy_set_header X-Real-IP $remote_addr; if ($host ~* testwap.skg.com) {rewrite ^/(.*)$ http://lifetestwap.skg.com/$1 permanent;}}location /shopfront/ec/pay/ {index  index.html index.htm index.jsp;proxy_pass   http://10.24.167.199:8089;proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;add_header From testwap.skg.com;proxy_cookie_path /shopfront/ec/pay/  /;proxy_set_header Cookie $http_cookie;}location  / {#root   html;index  index.html index.htm index.jsp;client_max_body_size    100m;proxy_pass   http://10.24.167.199:8088;proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;}}server {#listen       8000;listen       80;server_name  testapi.skg.com;
access_log logs/testapi.skg.com.access.log main;location / {#root   html;#index  index.html index.htm;proxy_pass   http://10.24.167.199:8086;proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;client_max_body_size    1000m;}}server {listen       80;server_name testadmin.skg.com;#charset koi8-r;#access_log  logs/host.access.log  main;location / {#root   html;index  index.html index.htm index.jsp;#client_max_body_size    100m;proxy_pass   http://10.24.167.199:8087;proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;}}server {listen       443;server_name testadmin.skg.com;#charset koi8-r;#access_log  logs/host.access.log  main;ssl on;ssl_certificate /usr/local/key/server.cer;ssl_certificate_key /usr/local/key/server2.key;ssl_session_timeout 5m;#access_log /var/log/nginx/access.log;#error_log /var/log/nginx/error.log;ssl_protocols SSLv2 SSLv3 TLSv1;ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLV2:+EXP;ssl_prefer_server_ciphers on; location / {#root   html;index  index.html index.htm index.jsp;#client_max_body_size    100m;proxy_pass   http://10.24.167.199:8087;proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;}}server {listen         80;server_name testd.skg.com;location = /generateImage.html {proxy_pass http://testd.skg.com/generateImage.html;}location /storefront/member/toLogin.html {rewrite . https://testlogin.skg.com/storefront/member/toLogin.html;}location /storefront/member/checkLogin.html{proxy_pass http://testd.skg.com/storefront/member/checkLogin.html;}location /storefront/member/cookieLogin.html{proxy_pass http://testd.skg.com/storefront/member/checkLogin.html;}location /wap.html{proxy_pass http://testd.skg.com/wap.html;}location /storefront/member/checkCertificateView.html{rewrite .  https://testlogin.skg.com/storefront/member/checkCertificateView.html;}location / {proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;proxy_pass   http://testd.skg.com;}}server {listen       443;server_name testlogin.skg.com; ssl on;ssl_certificate /usr/local/key/server.cer;ssl_certificate_key /usr/local/key/server2.key;ssl_session_timeout 5m;#access_log /var/log/nginx/access.log;#error_log /var/log/nginx/error.log;ssl_protocols SSLv2 SSLv3 TLSv1;ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLV2:+EXP;ssl_prefer_server_ciphers on; #charset koi8-r;location /storefront/member/toLogin.html{proxy_pass http://testd.skg.com/storefront/member/toLogin.html;}location /storefront/member/getValidCode.html{proxy_pass http://testd.skg.com/storefront/member/getValidCode.html;}location /storefront/member/login.html{proxy_pass http://testd.skg.com/storefront/member/login.html;}location /storefront/member/checkLogin.html{proxy_pass http://testd.skg.com/storefront/member/checkLogin.html;}location /storefront/member/cookieLogin.html{proxy_pass http://testd.skg.com/storefront/member/cookieLogin.html;}location /storefront/member/checkCertificateView.html{proxy_pass http://testd.skg.com/storefront/member/checkCertificateView.html;}location /storefront/member/registerByEmail.html{proxy_pass http://testd.skg.com/storefront/member/registerByEmail.html;}location /storefront/member/registerByMobile.html{proxy_pass http://testd.skg.com/storefront/member/registerByMobile.html;}location /storefront/member/logout.html{proxy_pass http://testd.skg.com/storefront/member/logout.html;}location /generateImage.html{proxy_pass http://testd.skg.com/generateImage.html;}location ~* \.(css|js)${root /usr/local/nginx/html/;access_log off;}

}

server {listen       443;server_name testskg.skg.com; ssl on;ssl_certificate /usr/local/key/server.cer;ssl_certificate_key /usr/local/key/server2.key;ssl_session_timeout 5m;#access_log /var/log/nginx/access.log;#error_log /var/log/nginx/error.log;ssl_protocols SSLv2 SSLv3 TLSv1;ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLV2:+EXP;ssl_prefer_server_ciphers on; #charset koi8-r;if ( $request_uri ~* ^/index\.htm$ ){rewrite  ^/index\.htm$   http://testskg.skg.com permanent;}       #location = / {
#      root /usr/local/nginx/html; 
#      index  index.htm index.html;
#      access_log off; 
#     }location ^~ /scripts/{root /usr/local/nginx/html/scripts;access_log off;}location ^~ /styles/{root /usr/local/nginx/html/styles;access_log off;}}server {listen       80;server_name  testo.skg.com;location / {index  index.html index.htm index.jsp;proxy_pass http://testo.skg.com;proxy_set_header Host $host;proxy_set_header X-Forward-For $remote_addr;proxy_set_header X-Real-IP $remote_addr;}}

}

`

转载于:https://my.oschina.net/u/2419285/blog/844848

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/396674.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

小孩用计算机做作业怎么表达,计算机作业

满意答案尧Dreaman夕2014.09.25采纳率:40% 等级:10已帮助:1121人Windows中可以设置、控制计算机硬件配置和修改桌面布局的应用程序是( D)A) Word B) Excel C)资源管理器 D)控制面板多窗口的切换可以通过(D )来实现A)在任务栏上用鼠标单击右…

[No0000178]改善C#程序的建议1:非用ICloneable不可的理由

好吧,我承认,这是一个反标题,实际的情况是:我找不到一个非用ICloneable不可的理由。事实上,接口ICloneable还会带来误解,因为它只有一个Clone方法。 我们都知道,对象的拷贝分为:浅拷…

SOM 的两种算法

我参考了这篇文章http://www.scholarpedia.org/article/Kohonen_network另一个很好的演示在这里http://www.math.le.ac.uk/people/ag153/homepage/PCA_SOM/PCA_SOM.htmlSOMt是训练步一个输入数据是n维向量待训练的是一堆节点,这堆节点之间有边连着,通常是…

秒懂,Java 注解 (Annotation)你可以这样学

转自: https://blog.csdn.net/briblue/article/details/73824058 文章开头先引入一处图片。 这处图片引自老罗的博客。为了避免不必要的麻烦,首先声明我个人比较尊敬老罗的。至于为什么放这张图,自然是为本篇博文服务,接下来我自会说明。好了…

Java技术中的三大特性

为什么80%的码农都做不了架构师?>>> 1.虚拟机 Java虚拟机JVM(Java Virtual Machine)在Java编程里面具有非常重要的地位,约相当…

matlab图像增强分段线性函数_图像增强、锐化,利用 PythonOpenCV 来实现 4 种方法!...

图像增强目的使得模糊图片变得更加清晰、图片模糊的原因是因为像素灰度差值变化不大,图片各区域产生视觉效果似乎都是一样的, 没有较为突出的地方,看起来不清晰的感觉解决这个问题的最直接简单办法,放大像素灰度值差值、使图像中的…

计算机考研保护一志愿,考研良心大学,保护一志愿的考研名校!

大家好,我是,今天胖胖要跟大家送一些重要的干货,就是对于选学校的小伙伴来说也好,或者是即将要参加研究生复试的小伙伴们来好胖胖在这里要跟大家说一个关于考研白名单的事情,因为大家都知道考研是会分黑名单和白名单&a…

华为备份历史版本_华为手机NAS备份时提示“需处于同一局域网”的解决方法

本内容来源于什么值得买APP,观点仅代表作者本人 |作者:噩梦飘雷创作立场声明:在使用华为手机向群晖NAS中备份时发现一直无法成功,经过一番研究找到了解决方案,希望能帮到大家~前言最近看了一位老哥的帖子&a…

【原创】自己编写的JavaGUI一键生成(hibernate/spring/mvc/maven)工具(附带视频教程源码)...

为什么80%的码农都做不了架构师?>>> 带项目源码(https://git.oschina.net/qsyan/GeneratorFx) app下载地址(附带视频教程):http://download.csdn.net/detail/juyan2008/9769406 注明:此应用采用javafx编写…

普通计算机怎么算根号_大学专业介绍 | 计算机专业的真实就业情况

前两天给大家简单介绍了近些年比较火的计算机类相关专业具体都有哪些不同,以及就业时的行业或者岗位的侧重点。今天呢我们继续这个话题,来聊一聊整个计算机相关专业在学习和就业过程中大概是什么样子的,希望能够给大家提供一些实实在在的参考…

设计模式总结篇系列:工厂方法模式(Factory Method)

工厂方法模式适合于对实现了同一接口或继承了同一父类的一些类进行实例的创建。一般是通过定义一个工厂类,并在其方法中实现对具有上述特点的类对象的创建。 根据具体产生类对象的方法定义形式,又可以将其分为普通工厂方法模式、多个工厂方法模式和静态工…

高新园区到大连计算机学校,大连高新区中心小学

大连市高新区中心小学简介:大连市高新区中心小学始建于2009年9月,是大连高新技术产业园区筹建的第一所直属公办学校。学校现拥有2000多名学生,87名教职员工。学校确定了“办诗韵教育,让每个孩子都幸福的教育理念”,通过…

0限流电阻 stm32_上/下拉电阻

除了前一节讨论的拉电阻基本使用方法外,上拉电阻也可以提升高电平的电压阈值,以便于前后级信号相匹配,比如,TTL逻辑电平驱动CMOS逻辑电平时,我们通常会添加一个上拉电阻R1,如下图所示:But Why&a…

网段和子网的区别_电焊石笼网与普通石笼网区别

对于石笼网,每个人都会想到在河中,桥梁附近和大坝上充满石头的笼子结构。今天,我们谈论的是石笼网的一种电焊石笼网,它也是一种常见的石笼网,也被称为六边形石笼网。其功能与石笼网相同,但用法与普通石笼网…

jquery $(document).ready() 与window.onload的区别

转载博客:http://www.jb51.net/article/21628.htm Jquery中$(document).ready()的作用类似于传统JavaScript中的window.onload方法,不过与window.onload方法还是有区别的。 1.执行时间 window.onload必须等到页面内包括图片的所有元素加载完毕后…

小学三年级上册计算机计划,小学三年级数学上册教学计划

小学三年级数学上册教学计划一、班级情况分析这一学期我继续担任三年级数学教学工作,本班现有学生9人,其中男生3人,女生6人。三年级学生已经有两年的数学学习经历,对一些基础性的数学知识有了初步的认识。学生已经比较习惯于新教材…

centos7查看当前cpu运行模式_杂集:centos7中设置服务开机自启的两种方法,欢迎补充...

前言:在日常使用linux系统过程中,安装服务后系统不会自动启动服务的。就算手动启动了服务,只是当前生效,一旦服务器重启后,系统不会自动启动这些服务。如果每次重启服务器都要自己手动启动这些服务,一台还阔…

Sort HDU5884(二分+多叉哈夫曼树)

HDU5884 Sort 题意:有n个序列要进行归并,每次归并的代价是两个序列的长度的和,要求最终的代价不能超过规定的T,求在此前提下一次能同时进行归并的序列的个数k。 思路:还是太单纯,看完题目一直以为要用归并排…

Linux系统(五)负载均衡LVS集群之DR模式

序言 DR模式是lvs集群中三种负载均衡模式的其中一种,那么上一篇中我写啦关于NAT模式的搭建与原理,为什么还要有DR模式与IP隧道模式呢? 首先我们来看3张图。LVS/NAT模式如下图: LVS/IP隧道模式,如下图: LVS/…

Redux API之applyMiddleware

applyMiddleware(...middlewares) 使用包含自定义功能的 middleware 来扩展 Redux 是一种推荐的方式。Middleware 可以让你包装 store 的dispatch 方法来达到你想要的目的。同时, middleware 还拥有“可组合”这一关键特性。多个 middleware 可以被组合到一起使用&a…