码迷,mamicode.com
首页 > 其他好文 > 详细

Nginx简易配置文件(二)(反向代理)

时间:2016-04-07 20:42:03      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:

user  nobody nobody;
worker_processes  4;

error_log       logs/error.log;
pid             logs/nginx.pid;

events {
    use epoll;
    worker_connections  1024;
}


http {
    include             mime.types;
    default_type        application/octet-stream;

    sendfile            on;
    keepalive_timeout   65;

    access_log          logs/access.log;
    log_format  main  ‘$remote_addr - $remote_user [$time_local] "$request" ‘
                      ‘$status $body_bytes_sent "$http_referer" ‘
                      ‘"$http_user_agent" "$http_x_forwarded_for"‘;

	    upstream cluster_17 {
        server 192.168.1.103:80;
    }
	
	    server {
        listen 80;
        server_name 17.test.com;

         location / {
            proxy_pass http://cluster_17;
        }
    }
  

    upstream cluster_17w {
        server 192.168.1.103:8011;
    }
	
	server {
        listen 80;
        server_name 17w.test.com;

         location / {
            proxy_pass http://cluster_17w;
        }
    }

  include /usr/local/nginx/conf/vHost/*.conf;
}

 

Nginx简易配置文件(二)(反向代理)

标签:

原文地址:http://www.cnblogs.com/configure/p/5364842.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!