- 浏览: 252157 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (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 2752问题现象: nginx配置反向代理后,网页可以正常访问, ... -
nginx反向代理demo
2017-12-20 13:24 385#user nobody; worker_processes ... -
如何安装nginx_lua_module模块
2014-07-15 16:02 733nginx_lua_module是由淘宝的工程师清无(王晓哲) ... -
nginx不浏览直接下载文件
2014-07-10 14:02 1779当我们使用Nginx时,如果要让一些附件比如txt,pdf,d ... -
nginx的upstream目前支持5种方式的分配
2014-07-07 08:43 514nginx的upstream目前支持5 ... -
Nginx设置proxy_cache缓存
2014-06-27 09:24 530Nginx原先是没有proxy_cache功能的,貌似从0.8 ... -
Varnish配置
2014-06-24 14:31 723# This is a basic VCL configu ... -
ngix缓存设置详解
2014-06-24 14:28 643#user nobody; worker_proces ... -
谈谈varnish,squid,apache,nginx缓存的对比
2014-06-24 14:18 588群里总是有人在问cache用什么,有varnish,squid ... -
nginx启动,重启,关闭命令
2014-06-19 15:19 507停止操作 停止操作是通 ... -
./configure: error: the HTTP rewrite module requires the PCRE library
2014-06-19 13:57 589有时候,我们需要单独安装nginx,来处理大量的下载请求。单独 ... -
Nginx配置文件详细说明
2013-03-18 14:06 636在此记录下Nginx服务器ng ... -
linux 安装Nginx-0.8.54
2013-03-18 09:39 716今天安装了nginx,主要参考下面的两篇文章。主要是第一篇,但 ...
相关推荐
nginx负载均衡配置文件实例:基本配置说明文档和一个配置好的nginx.conf文件实例
Nginx+tomcat配置集群负载均衡实现动静分离实例
使用nginx+eureka实现微服务的高负载均衡,提高网站的访问性能
Nginx实现负载均衡 web均衡负载 webservice负载均衡 Nginx实现负载均衡配制全说明 为了多台后台的web、webservice服务能均衡负载,可以使用nginx进行处理 1)配置文件全配制ok 2)有两个完整的web服务做例子,可以...
轮询即Round Robin,根据Nginx配置文件中的顺序,依次把客户端的Web请求分发到不同的后端服务器。 配置的例子如下: http{ upstream sampleapp { server <<dns>>; server <<another>>; } .... server{ ...
主要介绍了Nginx做NodeJS应用负载均衡配置实例,本文直接给出配置实例,需要的朋友可以参考下
nginx服务器做负载均衡的配置实例,可以用于进行服务器的配置
nginx一般可以用于七层的负载均衡,这篇文章将介绍一些负载均衡的基本知识以及使用nginx进行负载均衡的简单的例子。 四层负载均衡 vs 七层负载均衡 经常会说七层负载均衡还是四层负载均衡,其实根据ISO的OSI网络模型...
Nginx负载均衡【`重点`】Nginx为我们默认提供了三种负载均衡的策略: 轮询:将客户端发起的请求,平均的分配给每一台服务器。 权重:会将客户端的请求,根据服务器的权重值不同,分配不同的数量。 ip_...
一、nginx介绍及功能讲解 二、nginx的安装 三、nginx配置相关指令 四、nginx的实例应用(项目部署)
主要介绍了CentOS6.5环境安装nginx服务器及负载均衡配置操作,结合实例形式较为详细的分析了CentOS6.5环境安装nginx服务器及负载均衡配置具体步骤、命令与相关问题解决方法,需要的朋友可以参考下
第6章 Nginx HTTP负载均衡和反向代理的配置与优化.pdf 第7章 Nginx的Rewrite规则与实例.pdf 第8章 Nginx模块开发.pdf 第9章 Nginx的Web缓存服务与新浪网的开源NCACHE模块.pdf 第10章 Nginx在国内知名网站中的应用...
8.4. 负载均衡配置 9. 安装PHP 10. PHP-FPM 10.1. 什么是PHP-FPM 10.2. 为什么要是使用PHP-FPM 10.3. 安装并且启动PHP-FPM 10.3.1. 安装 10.3.2. fpm的配置 10.3.3. 启动和停止 10.3.4. 自启动php-fpm ...
11.nginx配置实例(负载均衡) 12.nginx配置实例(动静分离准备工作) 13.nginx配置实例(动静分离) 14.nginx配置实例(高可用准备工作) 15.nginx配置实例(高可用主备模式) 16.nginx配置实例(高可用配置...
6.3 Nginx负载均衡与反向代理的配置实例 6.4 Nginx负载均衡的HTTP Upstream 模块 6.5 Nginx负载均衡服务器的双机高可用 第7章 Nginx的Rewrite规则编写实例 7.1 什么是Nginx的Rewrite规则 7.2 Nginx Rewrite规则...
目标:Nginx做为HttpServer,连接多个tomcat应用实例,进行负载均衡。 注:本例程以一台机器为例子,即同一台机器上装一个nginx和2个Tomcat且安装了JDK1.7。 1、安装Nginx 安装Nginx教程 2、配置两个Tomcat 在本机上...
6.3 Nginx负载均衡与反向代理的配置实例 6.4 Nginx负载均衡的HTTP Upstream模块 6.5 Nginx负载均衡服务器的双机高可用 第7章 Nginx的Rewrite规则与实例 7.1 什么是Nginx的Rewrite规则 7.2 Nginx Rewrite规则相关指令...
第1章 Nginx简介 第2章 Nginx服务器的安装与配置 第3章 Nginx的基本配置与优化 ...第6章 Nginx HTTP负载均衡和反向代理的配置与优化 第7章 Nginx的Rewrite规则与实例 第8章 Nginx模块开发 ..........................