先上Nginx在Window上的基本常用指令:

IP_hase也可以解决Session共享的问题:不过不推荐这样使用,建议使用 Memcache/redis来处理 session共享的问题

轮询还是权重?(权重就是在后面加上 weight=2 ,这个主要是根据服务器实际的性能来考虑,数据越大命中的机会就越多):

配置截图:

附上完整的配置内容  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 zrfWeb{
server localhost:;
server localhost: weight=;
server localhost:;
} server {
listen ;
server_name 127.0.0.1:; #charset koi8-r; #access_log logs/host.access.log main; location / {
proxy_pass http://zrfWeb;
#deny 127.0.0.1;#拒绝的ip
#allow 172.18.9.100 #允许的ip root html;
index index.html index.htm;
} #error_page /.html; # redirect server error pages to the static page /50x.html
#
error_page /50x.html;
location = /50x.html {
root html;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:;
# 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 ;
# listen localhost:;
# server_name somename alias another.alias; # location / {
# root html;
# index index.html index.htm;
# }
#} # HTTPS server
#
#server {
# listen ssl;
# server_name localhost; # ssl_certificate cert.pem;
# ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; # location / {
# root html;
# index index.html index.htm;
# }
#} }

最新文章

  1. 【视频处理】YUV与RGB格式转换
  2. MVC利用MvcHtmlString在后台生成HTML
  3. wpf中手风琴控件Accordion编辑模板后控件不正常。
  4. laravel 部分路由取消csrf
  5. ICANN认证企业列表
  6. 自己写一个与startWith类似的判断方法
  7. Android入门1:使用VideoView和MediController播放视频
  8. 分享几个社交类网站常用并且也是最好用的jquery类库
  9. 如何自动以管理员身份运行.NET程序?
  10. CString转换为const char*
  11. JavaScript 基本类型值-Number类型
  12. Senparc.Weixin SDK 微信公众号 .NET 开发教程 索引
  13. Programming好文解读系列(—)——代码整洁之道
  14. 使用perconna xtrabackup备份脚本
  15. 【一些容易忘记的node的npm命令】【收集】
  16. (转)python logging模块
  17. 介绍 Jersey 依赖
  18. Android开发小问题解决汇总
  19. SQL语言:DDL/DML/DQL/DCL
  20. PHP+JQUERY+AJAX上传、裁剪图片

热门文章

  1. Flume和Kafka完成实时数据的采集
  2. 编程范式 --- 面向协议编程(Protocol Oriented Programming,简称POP)
  3. idea创建javaweb原生项目
  4. 如何把安全证书导入到java中的cacerts证书库(转)
  5. mysql 遍历方式
  6. php无限级分类实战——评论及回复功能
  7. 特殊的ARP
  8. Patorjk
  9. Docker5-docker私库的搭建及常用方法-harbor-registry方式
  10. BUUCTF刷题记录(Web方面)