#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  mySite.com { #服务器集群名字   
  server 192.168.1.101:8080 weight=1;#服务器配置 weight是权重的意思,权重越大,分配的概率越大。  
  server 192.168.1.102:8080 weight=1;  
  }
 
  server {
  listen 80;
  server_name localhost;
 
  #charset koi8-r;
 
  #access_log logs/host.access.log main;
 
  location / {
  proxy_pass http://mySite.com;  
  proxy_redirect default;
  }
 
  #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 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;
  # }
  #}
 
}
 

nginx.conf完整配置实例的更多相关文章

  1. nginx.conf 完整的集群配置

    ###############################nginx.conf 整配置############################### #user nobody; # user 主模 ...

  2. Nginx配置文件(nginx.conf)配置详解(2)

    Nginx的配置文件nginx.conf配置详解如下: user nginx nginx ; Nginx用户及组:用户 组.window下不指定 worker_processes 8; 工作进程:数目 ...

  3. Nginx负载均衡配置实例详解

    负载均衡是我们大流量网站要做的一个东西,下面我来给大家介绍在Nginx服务器上进行负载均衡配置方法,希望对有需要的同学有所帮助哦. 负载均衡 先来简单了解一下什么是负载均衡,单从字面上的意思来理解就可 ...

  4. Nginx负载均衡配置实例详解(转)

    负载均衡是我们大流量网站要做的一个东西,下面我来给大家介绍在Nginx服务器上进行负载均衡配置方法,希望对有需要的同学有所帮助哦. 负载均衡 先来简单了解一下什么是负载均衡,单从字面上的意思来理解就可 ...

  5. Nginx配置文件(nginx.conf)配置详解

    Nginx的配置文件nginx.conf配置详解如下: user nginx nginx ; Nginx用户及组:用户 组.window下不指定 worker_processes 8; 工作进程:数目 ...

  6. Nginx 线上配置实例

    1 /etc/nginx/nginx.conf,在主配置下设置 /etc/nginx/conf.d/*.conf user nginx;worker_processes 1; error_log /v ...

  7. Nginx配置文件(nginx.conf)配置具体解释

    欢迎扫码增加Java高知群交流 Nginx的配置文件nginx.conf配置具体解释例如以下:   user nginx nginx ; Nginx用户及组:用户 组. window下不指定   wo ...

  8. Nginx配置文件(nginx.conf)配置详解[转]

    转自:http://blog.csdn.net/tjcyjd/article/details/50695922 重新学习,发觉这篇文章写得很详细就摘录了! Nginx的配置文件nginx.conf配置 ...

  9. Nginx.conf参数配置详解

    Nginx的配置文件nginx.conf配置详解如下: user nginx nginx; #Nginx用户及组:用户 组.window下不指定 worker_processes 8; #工作进程:数 ...

随机推荐

  1. Java数据结构整理(一)

    ava数据结构内容整理关键字: 数据结构 Collection:List.SetMap:HashMap.HashTable如何在它们之间选择一.Array , ArraysJava所有“存储及随机访问 ...

  2. java系列--并发

    1.Executor 原博:http://blog.csdn.net/linghu_java/article/details/17123057 2.CountDownLatch()方法 浅析Java中 ...

  3. Linux_System2

    1.从服务器下载http*.tar.gz源码包,安装到/usr/local/apache目录下,要求安装时指定能够动态加载模块,能够支持地址回写功能,能够使用ssl加密功能../configure — ...

  4. Python3基础 pop() 删除 键为指定值的项

    镇场诗: 诚听如来语,顿舍世间名与利.愿做地藏徒,广演是经阎浮提. 愿尽吾所学,成就一良心博客.愿诸后来人,重现智慧清净体.-------------------------------------- ...

  5. 绘图——Android绘图基础:Canvas、Paint等

    Android的绘图应该继承View组件,并重写它的onDraw(Canvas canvas)方法即可. 重写onDraw(Canvas canvas)方法时涉及一个绘图API:Canvas,Canv ...

  6. AngularJs ui-router 路由的介绍

    AngularJs ui-router 路由介绍 野兽之前有写过一篇关于Angular自带的路由:ngRoute.今天来说说Angular的第三方路由:ui-router.那么有人就会问:为什么Ang ...

  7. Mac下启动MySQL出现错误“the /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' user”解决

    错误如下: Warring the /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' user 这应该是某 ...

  8. CFD-post的奇技淫巧

    此处记录两个后处理美化的技巧:1.关于contour显示的美化:2.关于legend的显示美化 1. 直接举例说明,现在cfd-post里导入了一个二维case,先建立一个plane: apply以后 ...

  9. Xtrabackup构建MySQL主从环境

    环境:HE3主库,HE1从库 HE1:192.168.1.248 HE3:192.168.1.250 从库my.cnf加入以下参数并重启数据库: read_only=1 log_slave_updat ...

  10. 如何设置secureCRT的鼠标右键为弹出文本操作菜单功能

    secureCRT的鼠标右键功能默认是粘贴的功能,用起来和windows系统的风格不一致, 如果要改为右键为弹出文本操作菜单功能,方便对选择的内容做拷贝编辑操作,可以在 options菜单----&g ...