#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. web 前端routine

    HTML:check CSS : check Javascript: struggling 框架:—— SQL:—— http://www.cnblogs.com/kzang/tag/SQL/ web ...

  2. html css基础(一)

    1.HTML:做静态网页,是一种标签语言, HTML结构: 一个HTML文档由4个基本部分组成: ① 一个文档声明:<!DOCTYPE HTML> ② 一个html标签对:<html ...

  3. 再次写了第一个servlet

    费时2小时,熟悉tomcat和编写了第一个servlet

  4. UVa 10226 - Hardwood Species

    题目大意:给出n棵树(有重复),统计每种树出现的频率.使用STL的map. #include <cstdio> #include <iostream> #include < ...

  5. OS X EI Capitan 10.11 & xcode 7.0 beta(7A120f) -- cocoapods安装失败

    1.sudo gem install cocoapods: ERROR:While executing gem ... (Errno:EPERM) Operation not permitted - ...

  6. 前端开发 Grunt 之 Connect详解

    在前端开发过程中,我们需要在开发过程中,将开发中的站点部署到服务器上,然后,在浏览器中查看实际的效果,在 Grunt 环境下,可以直接使用集成在 Grunt 中的 Connect 插件完成站点服务器的 ...

  7. DevExpress控件学习总结2(转)

    1.TextEditor(barEditItem)取文本string editValue = barEditItem1.EditValue.ToString(); //错误,返回null string ...

  8. 1.1.Core Data是什么(Core Data 应用程序实践指南)

    Core Data是个框架,把数据当作对象来操作. 由Core Data提供的数据对象叫托管对象(managed objecgt),而Core Data 位于程序和持久化存储区之间. 托管对象模型里有 ...

  9. js原生设计模式——13桥接模式(相同业务逻辑抽象化处理的职责链模式)

    桥接模式之多元化类之间的实例化调用实例 <!DOCTYPE html><html lang="en"><head>    <meta ch ...

  10. C# 安装包制作

    VS制作安装包的一般步骤. 一·新建项目 (1)新建 (2)界面跳转 二·添加引用 (1)添加卸载程序 1.在'C:WINDOWSsystem32'路径下,找到msiexec.exe . 2.将msi ...