• [Nginx]


    nginx.conf文件内容:

    user  www www;
    worker_processes  2;
    
    error_log  /usr/local/nginx/logs/serror.log crit;
    pid        /usr/local/nginx/logs/nginx.pid;
    
    #Specifies the value for maximum file descriptors that can be opened by this process. 
    worker_rlimit_nofile 65535;
    
    events 
    {
      use epoll;
      worker_connections 65535;
    }
    
    
    http {
    	include       mime.types;
    	default_type  application/octet-stream;
    
    	#charset  gb2312;
    
    	server_names_hash_bucket_size 128;
    	client_header_buffer_size 32k;
    	large_client_header_buffers 4 32k;
    	client_max_body_size 8m;
    
    	sendfile on;
    	tcp_nopush     on;
    
    	keepalive_timeout 60;
    
    	tcp_nodelay on;
    
    	fastcgi_connect_timeout 300;
    	fastcgi_send_timeout 300;
    	fastcgi_read_timeout 300;
    	fastcgi_buffer_size 64k;
    	fastcgi_buffers 4 64k;
    	fastcgi_busy_buffers_size 128k;
    	fastcgi_temp_file_write_size 128k;
    
    	gzip on;
    	gzip_min_length  1k;
    	gzip_buffers     4 16k;
    	gzip_http_version 1.0;
    	gzip_comp_level 2;
    	gzip_types       text/plain application/x-javascript text/css application/xml;
    	gzip_vary on;
    	#limit_zone  crawler  $binary_remote_addr  10m;
    	log_format '$remote_addr - $remote_user [$time_local] "$request" '
    	              '$status $body_bytes_sent "$http_referer" '
    	              '"$http_user_agent" "$http_x_forwarded_for"';
    	include /usr/local/nginx/conf/vhosts/*.conf;
    }
    

    在vhosts目录下的conf文件内容:

    upstream slave {
    	server xxx.xxx.xxx.xxx max_fails=3 fail_timeout=30s weight=5;
    	server xxx.xxx.xxx.xxx max_fails=3 fail_timeout=30s weight=5;
    }
    
    server {
    	listen	80;
    	server_name  www.XXX.com;
    	
    	#if ($uri ~* "(/login$|/login.html$|/login/index.html$|/admin/.+|/signup$|/signup/.+$|/signup.html$)") {
    	#	return	301	https://$server_name$request_uri;
    	#}
    
    	location / {
    		client_max_body_size 200m;
    		proxy_pass http://slave;
    		proxy_set_header Host $host;
    		proxy_set_header X-Real-IP $remote_addr;
    		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    		client_body_buffer_size 128k;
    		proxy_connect_timeout 600;
    		proxy_read_timeout 600;
    		proxy_send_timeout 600;
    		proxy_buffer_size 64k;
    		proxy_buffers 4 32k;
    		proxy_busy_buffers_size 64k;
    		proxy_temp_file_write_size 64k;
    	}
    
    	location = /50x.html {
    		root   html;
    	}
    }
    
    server{
    	listen 443;
    	ssl on;
    	ssl_certificate /alidata/ssl/server.crt;
    	ssl_certificate_key /alidata/ssl/server.key;
    	server_name  www.XXX.com;
    	
    	#if ($uri !~* "(/login$|/login.html$|/login/index.html$|/static/.+|/common/api/.+|/admin/.+|/signup$|/signup/.+$|/signup.html$)") {
    	#	return	301	http://$server_name$request_uri;
    	#}
    
    	location / {
    		client_max_body_size 200m;
    		proxy_pass http://slave;
    		proxy_set_header Host $host;
    		proxy_set_header X-Real-IP $remote_addr;
    		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    		client_body_buffer_size 128k;
    		proxy_connect_timeout 600;
    		proxy_read_timeout 600;
    		proxy_send_timeout 600;
    		proxy_buffer_size 64k;
    		proxy_buffers 4 32k;
    		proxy_busy_buffers_size 64k;
    		proxy_temp_file_write_size 64k;
    		proxy_set_header X-Forwarded-Proto $scheme;
    		proxy_redirect off;
    	}
    
    	location = /50x.html {
    		root   html;
    	}
    }
    

      

  • 相关阅读:
    PHP命令行执行程序php.exe使用及常用参数
    如何搜百度云盘里别人分享的文件
    WIN8下笔记本共享热点的设置
    COMPANY_点取消会卡死的解决方法
    python urllib
    windows技术
    五分钟搞定Linux容器
    分分钟教你制作完美的虚拟机镜像
    事件日志监控工具推荐
    Linux服务器管理员必备Linux命令TOP5
  • 原文地址:https://www.cnblogs.com/HD/p/5646299.html
Copyright © 2020-2023  润新知