- 浏览: 265363 次
- 性别:
- 来自: 上海
-
文章分类
- 全部博客 (298)
- 工作感悟 (6)
- java基础 (23)
- 计算机硬件知识 (1)
- 计算机网络知识 (2)
- Struts (3)
- Srping (4)
- hibernate (0)
- ibatis (0)
- webservice (4)
- Thread (22)
- maven (5)
- ubuntu/linux/centos/redhat (46)
- SSO (1)
- ESB (0)
- 工作流 (0)
- oracle (15)
- 云计算 (1)
- hadoop (1)
- nosql (0)
- mysql (3)
- sqlserver (0)
- jquery (0)
- 分布式 (3)
- 集群 (0)
- 设计模式 (2)
- EJB (0)
- map (0)
- cache (5)
- Niginx+varnish+squid+Ats (14)
- Apache (0)
- 工作/职业规划 (0)
- Scala & Groovy (1)
- English (4)
- 数据结构/算法 (6)
- 开发工具 (5)
- 测试 (2)
- Exception (0)
- 定时器 (3)
- j2ee (2)
- 部署 (1)
- Openssl (1)
- 操作系统 (3)
- kvm (13)
- libvirt (5)
- PostgreSql (5)
- 虚拟化 (3)
- 概念理解 (1)
- virt-manager (1)
- RESTful (3)
- 其它 (4)
- ssh2 (14)
- windows (1)
- 房产 (2)
- svn (1)
- 手机 (1)
- ant (1)
- flume (2)
- sqoop (1)
- fastdfs (5)
- log4j (1)
- SPDY (1)
- mongodb (2)
- MQ (2)
- Mina (1)
- dubbo (4)
- PMP (1)
- Webshpere (2)
- jvm (1)
- Btrace (1)
- zookeeper (7)
- UML (1)
- spring cloud (6)
- spring boot (5)
- storm (0)
- 软件管理 (1)
- elasticsearch (1)
- 协议 (2)
- docker (1)
- 性能 (2)
- 安全 (1)
- 代码规范 (1)
- mqtt (1)
- lombok (1)
- 车联网 (1)
- kafka (1)
最新评论
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
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 0;
keepalive_timeout 65;
#gzip on;
#设定负载均衡列表
upstream backend {
#ip_hash;
server 192.168.0.21:8099;
server 192.168.0.205:7080;
#server 192.168.0.26:80;
}
server {
listen 8888;
server_name 192.168.0.26;
#server_name 127.0.0.1;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
#root D:/web;
index index.html index.htm;
proxy_redirect off;
#保留用户真实信息
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://backend;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443;
# server_name localhost;
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_timeout 5m;
# 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;
# }
#}
}
发表评论
-
nginx设置反向代理后,页面上的js css文件无法加载
2018-09-06 18:32 2853问题现象: nginx配置反向代理后,网页可以正常访问, ... -
nginx反向代理demo
2017-12-20 13:24 410#user nobody; worker_processes ... -
如何安装nginx_lua_module模块
2014-07-15 16:02 784nginx_lua_module是由淘宝的工程师清无(王晓哲) ... -
nginx不浏览直接下载文件
2014-07-10 14:02 1864当我们使用Nginx时,如果要让一些附件比如txt,pdf,d ... -
nginx的upstream目前支持5种方式的分配
2014-07-07 08:43 535nginx的upstream目前支持5 ... -
Nginx设置proxy_cache缓存
2014-06-27 09:24 563Nginx原先是没有proxy_cache功能的,貌似从0.8 ... -
Varnish配置
2014-06-24 14:31 756# This is a basic VCL configu ... -
ngix缓存设置详解
2014-06-24 14:28 667#user nobody; worker_proces ... -
谈谈varnish,squid,apache,nginx缓存的对比
2014-06-24 14:18 618群里总是有人在问cache用什么,有varnish,squid ... -
nginx启动,重启,关闭命令
2014-06-19 15:19 534停止操作 停止操作是通 ... -
./configure: error: the HTTP rewrite module requires the PCRE library
2014-06-19 13:57 638有时候,我们需要单独安装nginx,来处理大量的下载请求。单独 ... -
Nginx配置文件详细说明
2013-03-18 14:06 661在此记录下Nginx服务器ng ... -
linux 安装Nginx-0.8.54
2013-03-18 09:39 757今天安装了nginx,主要参考下面的两篇文章。主要是第一篇,但 ...
相关推荐
**Nginx负载均衡配置详解** Nginx是一款高性能的HTTP和反向代理服务器,它以其轻量级、高并发的特性在Web服务领域广泛应用。其中,Nginx的负载均衡功能是其重要特性之一,它能有效地分散网络流量,提高系统可用性和...
Nginx实现负载均衡 web均衡负载 webservice负载均衡 Nginx实现负载均衡配制全说明 为了多台后台的web、webservice服务能均衡负载,可以使用nginx进行处理 1)配置文件全配制ok 2)有两个完整的web服务做例子,可以...
下面详细解释Nginx负载均衡的配置方法以及负载均衡策略。 首先,要配置Nginx与Tomcat实现负载均衡,需要准备两个Tomcat实例,每个实例可以部署一个简单的Web项目,例如通过在页面上标注不同的端口号,以便区分它们...
本实例将详细阐述如何通过Nginx配置集群负载均衡,以实现动静分离,提升系统性能和稳定性。 首先,Nginx是一款轻量级的Web服务器/反向代理服务器,以其高性能、稳定性以及低内存占用著称。它能处理静态文件请求,...
在构建高性能、高可用性的Web服务时,"redis+tomcat+nginx负载均衡配置"是一个常见且有效的架构模式。这个组合充分利用了各个组件的优势,确保系统稳定、响应快速,并能够处理大量的并发请求。以下是关于这个配置的...
本节主要介绍Nginx负载均衡配置。 1.2.3 Nginx配置 在nginx.conf文件中添加负载均衡配置,例如: upstream tomcat { server localhost:8080 weight=1; server localhost:8081 weight=1; } 四、压力测试 本节...
在进行 Nginx 负载均衡配置之前,我们需要确保有一个适合运行 Nginx 的环境。这通常涉及到以下几个方面: 1. **Java 环境**:由于某些应用可能依赖 Java,因此在 Tomcat 服务器上需要预先安装 JDK。这包括下载并...
本实例将讲解如何结合 `nginx` 和 `Eureka` 实现微服务的负载均衡,从而提高网站的访问性能。 1. **Nginx 负载均衡** - **工作原理**:Nginx 可以根据预设的策略(如轮询、最少连接、IP哈希等)将请求分发到多个...
### Nginx负载均衡配置详解 #### 一、前言 Nginx 是一款轻量级的 Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,并在一个BSD-like 协议下发行。其特点是占有内存少,并发能力强,事实上 Nginx 的...
### Nginx与Tomcat实现负载均衡的知识点详解 #### Nginx简介及特性 Nginx是一款由Igor Sysoev开发的高性能HTTP服务器和反向代理服务器,以其出色的稳定性和低系统资源消耗而著称。最初是为俄罗斯访问量排名第二的...
### Nginx在Windows平台下的负载均衡配置详解 #### 一、引言 负载均衡是现代Web应用架构中不可或缺的一部分,它可以有效提升系统的可用性和扩展性。本文将详细介绍如何在Windows平台上利用Nginx实现负载均衡,特别...
要实现负载均衡,需要在 Nginx 服务器上配置 upstream 模块,以便将请求分配到多台 Tomcat 服务器上。具体配置如下: 1. upstream netitcast.com { server 127.0.0.1:18080 weight=1; server 127.0.0.1:28080 ...
以下是配置Nginx负载均衡的基本步骤: 1. **安装Nginx**:在你的服务器上安装Nginx,确保它能够正常启动和运行。 2. **配置Nginx**:打开Nginx的配置文件(通常为`/etc/nginx/nginx.conf`或`/usr/local/nginx/conf...
6. 配置Nginx来实现负载均衡 四、Nginx配置 * 工作进程的个数(worker_processes)设置为1,与计算机的CPU核数一致 * 单个进程的最大连接数(worker_connections)设置为1024 * 文件扩展名与文件类型映射表(mime....
**Nginx负载均衡Tomcat简单配置** 在大型的Web应用系统中,为了提高服务的可用性和响应速度,通常会采用负载均衡技术。Nginx作为一款高性能的反向代理服务器,常被用来实现对后端多台Tomcat服务器的负载均衡。本篇...
#### 三、Nginx负载均衡配置示例 根据提供的部分内容,我们详细解析如何配置Nginx进行负载均衡: ##### 1. 单独使用一台Nginx做负载均衡 **配置文件示例**: ```nginx upstream local_tomcat { ip_hash; ...
**Nginx + Tomcat 负载均衡配置详解** 在现代互联网应用中,服务器的高可用性和性能优化是至关重要的。Nginx 和 Tomcat 的组合常常被用来实现这样的目标,其中Nginx作为反向代理和负载均衡器,而Tomcat作为Java应用...
本文档将深入探讨如何配置Nginx来实现对Tomcat应用服务器的负载均衡,以提高系统的稳定性和效率。 一、Nginx简介 Nginx以其轻量级的进程模型、高效的并发处理能力以及丰富的模块化设计,成为部署静态资源和代理服务...
- [Nginx负载均衡配置实例](http://www.cnblogs.com/knowledgesea/p/5157565.html) #### 四、运行环境 **硬件环境:** - CPU: 至少双核处理器 - 内存: 至少4GB RAM - 存储空间: 至少20GB可用空间 **软件环境:** ...