云服务器 nginx + tomcat 部署集群 配置
nginx.conf
#user nobody;
worker_processes ; #error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid; events {
worker_connections ;
} 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"'; #access_log logs/access.log main; sendfile on;
#tcp_nopush on; #keepalive_timeout ;
keepalive_timeout ; #gzip on; upstream tomcats {
server 10.154.49.196:;
} upstream tomcats-quartz {
server 10.154.49.196:;
} server {
listen ;
server_name www.itzixi.com; #itzixi.com;
access_log /home/wwwlogs/www.itzixi.com_nginx.log combined;
root /home/wwwroot/www.itzixi.com;
index index.html index.htm index.jsp index.action index; #rewrite ^(.*)$ https://$host$1 permanent; location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
expires 30d;
access_log off;
} location ~ .*\.(js|css)?$ {
expires 7d;
access_log off;
} location ~ { #/ {
proxy_pass http://tomcats; # open tomcat servera
include proxy.conf;
} } # ssl(https) config
# server {
# listen ;
# server_name www.itzixi.com; # itzixi.com;
# access_log /home/wwwlogs/www.itzixi.com_nginx.log combined;
# root /home/wwwroot/www.itzixi.com;
# index index.html index.htm index.jsp index.action index;
#
# location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
# expires 30d;
# access_log off;
# }
#
# location ~ .*\.(js|css)?$ {
# expires 7d;
# access_log off;
# }
#
# ssl on;
# ssl_certificate 1_www.itzixi.com_bundle.crt;
# ssl_certificate_key 2_www.itzixi.com.key;
# ssl_session_timeout 5m;
# ssl_protocols TLSv1 TLSv1. TLSv1.;
# ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
# ssl_prefer_server_ciphers on;
# location ~ { #/ {
# proxy_pass http://tomcats; # open tomcat server
# include proxy.conf;
# }
#
# } # image server
server {
listen ;
server_name localhost;
#server_name www.itzixi.com itzixi.com; location /group1/M00 {
ngx_fastdfs_module;
}
} }
proxy.conf
proxy_connect_timeout 300s;
proxy_send_timeout ;
proxy_read_timeout ;
proxy_buffer_size 32k;
proxy_buffers 64k;
proxy_busy_buffers_size 128k;
proxy_redirect off;
proxy_hide_header Vary;
proxy_set_header Accept-Encoding '';
proxy_set_header Referer $http_referer;
proxy_set_header Cookie $http_cookie;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
server.xml,注释掉原来的host,加入下面这行
<Host name="localhost" appBase="" unpackWARs="true" autoDeploy="true">
<Context path=""
docBase="/home/wwwroot/www.itzixi.com"
reloadable="false"
crossContext="true"/>
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"
prefix="www.itzixi.com_access_log"
suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
项目从war包解压后放入此目录:
/home/wwwroot/www.itzixi.com
云服务器 nginx + tomcat 部署集群 配置的更多相关文章
- Nginx+Tomcat+MemCached 集群配置手册
系统实施文档 Nginx+Tomcat+MemCached 集群配置手册 目 录 第1章 概述 1.1 目标 互联网的快速发展带来了互联网系统的高负载和高可用性, 这要求我们在设计系统架 ...
- session服务器Nginx+Tomcat+Memcached集群Session共享
cookie是怎样工作的? 例如,我们创立了一个名字为login的Cookie来包含访问者的信息,创立Cookie时,服务器端的Header如下面所示,这里假设访问者的注册名是“Michael Jor ...
- nginx+tomcat实现集群,redis实现session共享,软连接实现文件共享:http://blog.csdn.net/hua1586981/article/details/78132710
转载 2017年02月08日 16:52:41 730 相信很多人都听过nginx,这个小巧的东西慢慢地在吞食apache和IIS的份额.那究竟它有什么作用呢?可能很多人未必了解. 说到反向代理,可能 ...
- Nginx + Tomcat搭建集群
一.Tomcat集群带来的好处 1.提高服务的性能,并发能力,以及高可用性 2.提供项目架构的横向扩展能力 二.Tomcat集群实现原理 通过Nginx负载均衡进行请求转发 三.Nginx + Tom ...
- 注意这几点,轻轻松松配置 Nginx + Tomcat 的集群和负载均衡
Tomcat 集群是当单台服务器达到性能瓶颈,通过横向扩展的方式提高整体系统性能的有效手段.Nginx 是一个高性能的 HTTP 和反向代理 web 服务器,可以通过简单的配置实现 Tomcat 集群 ...
- solrCloud+tomcat+zookeeper集群配置
solrcolud安装solrCloud+tomcat+zookeeper部署 转载请出自出处:http://eksliang.iteye.com/blog/2107002 http://eksli ...
- apache整合tomcat部署集群
近日,由于公司项目需要,所以学习了apache整合tomcat以及集群的一些知识. 所以做下笔记日后回顾可以用到. apache只有处理静态事物的能力, 而tomcat的强项就是处理动态的请求,所以a ...
- Nginx+Tomcat+Memcached 集群
写过一篇 Apache Httpd+Tomcat 的集群, 现在来看看Nginx+Tomcat+Memcached是怎么集群的. 先看看用的版本和工具: Nginx: nginx-1.8.1 Tomc ...
- windows下nginx+tomcat分布式集群部署
首先官网下载 http://nginx.org/en/download.html,我的本地环境为 实现的架构: 从图上可以看出,nginx作为负载均衡请求分发器,当请求A应用时候,分发到A集群,同理 ...
随机推荐
- [转]jquery设置select选中,赋值等操作
一.基础取值问题 例如<select class="selector"></select> 1.设置value为pxx的项选中 $(".selec ...
- 关于0xFFFFFFFF和alpha,温故而知新
做图像处理都好多年了,今天随手做个小画板的时候,发现一个挺有趣的小坑.而其实这个小坑,以前也坑过自己,不过太久没处理了,又踩到坑里了. 先来看看:0xFFFFFFFF>>24 这个结果是什 ...
- GoldenGate 12c 新特性 Credential Store and USERIDALIAS
GoldenGate 12C的Credential Store and USERIDALIAS新特性有点类似存储钱夹,提高了配置的易用性和安全性. --生成credentialstore文件 GGSC ...
- Changing the Language Used in ODI Studio
odi.conf中加入区域和语言设置 修改 "$ODI_HOME\odi\studio\bin\odi.conf" ( D:\Oracle\Middleware\Oracle ...
- 【Linux】文件权限
Linux的每一个文件都跟多种类型相关联.在这些权限中,我们通常需要和三类权限打交道(用户.用户组以及其他实体). 1.文件权限查看ls –l Linux:/qinys # ls -l total 6 ...
- .Net(c#)加密解密工具类:
/// <summary> /// .Net加密解密帮助类 /// </summary> public class NetCryptoHelper { #region des实 ...
- 浅谈Spring的PropertyPlaceholderConfigurer
大型项目中,我们往往会对我们的系统的配置信息进行统一管理,一般做法是将配置信息配置与一个cfg.properties的文件中,然后在我们系统初始化的时候,系统自动读取cfg.properties配置文 ...
- 整合ssm框架之配置文件
原文:https://blog.csdn.net/zwyanqing/article/details/53039591 ssm整合 一.applicationContext.xml 1.配置数据源 & ...
- java第七节 IO
/* *第七讲 IO/输入与输出 * * File类 * RandomAccessFile类 * 各种节点流类 * 字符编码 * 各种过滤流与包装类 * *File类 * File类是IO包中唯一代表 ...
- Quartz.NET开源作业调度框架系列(三):IJobExecutionContext 参数传递-转
前面写了关于Quartz.NET开源作业调度框架的入门和Cron Trigger , 这次继续这个系列, 这次想讨论一下Quartz.NET中的Job如何通过执行上下文(Execution Conte ...