zoukankan      html  css  js  c++  java
  • nginx 通用配置规则

    worker_processes  1;
    
    #error_log  logs/error.log;
    #error_log  logs/error.log  notice;
    #error_log  logs/error.log  info;
    
    events {
        worker_connections  1024;
    }
    
    # http conf
    http {
        #include     http/common.conf;
        #include     http/cache.conf;
        #include     http/resty.conf;
        #include     http/mime.types;
    
        include     http/*.conf;
    
        include     http/servers/*.conf;
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for" "$request_filename"';
         gzip on;
         gzip_min_length 1000;
         gzip_buffers 4 8k;
         gzip_types text/plain application/x-javascript text/css application/json application/xml text/javascript;
        access_log  logs/access.log  main; 
    	
        upstream backend1 {
        server 192.168.137.3:9000      weight=5;
        }
    
            #charset koi8-r;
    
            #access_log  logs/host.access.log  main;
        server{
            listen       8090;
            server_name  localhost;
            #ssl on;
            #从腾讯云获取到的第一个文件的全路径
             ssl_certificate /etc/ssl/server.pem;
             ssl_certificate_key /etc/ssl/server.key;
              location  /
                     {
                      proxy_pass http://backend1;
                      proxy_connect_timeout 300;
                      proxy_send_timeout 300;
                      proxy_read_timeout 300;
                      proxy_set_header   Host             $host;
                      proxy_set_header   X-Real-IP        $remote_addr;       
                      proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
     }
            }
    
    }
    
  • 相关阅读:
    Ubuntu 系统装机指南
    java读取配置文件属性
    反转单链表 递归与非递归
    迟到的2013年终总结
    2014年阅读资料总结
    程序人生的四个象限和两条主线
    查找单链表中倒数第k个结点
    技术人员应真正学会的第二课程
    Linux“七大蠢”收录
    postman测试方法,出现400错误码
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13348312.html
Copyright © 2011-2022 走看看