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

nginx.conf配置

时间:2016-07-04 10:12:05      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:

user www-data;
worker_processes 8;
pid /var/run/nginx.pid;

worker_rlimit_nofile 262144;

events {
	worker_connections 40000;
	# multi_accept on;
}

http {
	##
	# Basic Settings
	##

	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	# server_tokens off;

	server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

	include /etc/nginx/mime.types;
	default_type application/octet-stream;

	##
	# Logging Settings
	##

	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log;

	##
	# Gzip Settings
	##

	gzip on;
	gzip_disable "msie6";

	gzip_vary on;
	gzip_proxied any;
	gzip_comp_level 6;
	gzip_buffers 16 8k;
	gzip_http_version 1.1;
	gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

	##
	# nginx-naxsi config
	##
	# Uncomment it if you installed nginx-naxsi
	##

	#include /etc/nginx/naxsi_core.rules;

	##
	# nginx-passenger config
	##
	# Uncomment it if you installed nginx-passenger
	##
	
	#passenger_root /usr;
	#passenger_ruby /usr/bin/ruby;

	##
	# Virtual Host Configs
	##

	fastcgi_temp_path /tmp/ngx_fcgi_tmp;
	fastcgi_cache_path /tmp/ngx_fcgi_cache levels=2:2 keys_zone=fcgi:128m inactive=1d max_size=256m;
        fastcgi_cache_key "$scheme$request_method$host$request_uri";

	upstream backend
        {
           server xxx.xxx.xxx.xxx;
        }

	upstream db 
	{
	   server xxx.xxx.xxx.xxx;
	}

	upstream dota2
	{
	   server xxx.xxx.xxx.xxx; #DOTA
	}

	upstream users
	{
	   server xxx.xxx.xxx.xxx;
	}

	upstream lushi {

	   server xxx.xxx.xxx.xxx; #User
	}

	upstream dota2ob
	{
	   server xxx.xxx.xxx.xxx; #User
	}

	upstream lol
	{
	   server server xxx.xxx.xxx.xxx;#lol1
	}
	upstream gousu
        {
	   server server xxx.xxx.xxx.xxx;
	}

	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;
}

  

nginx.conf配置

标签:

原文地址:http://www.cnblogs.com/wlemory/p/5639527.html

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