• nginx


    #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 64;
    }
    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;
        #设定请求缓冲
        client_header_buffer_size    1k;
        large_client_header_buffers 4 4k;
        #开启gzip模块
        gzip on;
        gzip_min_length 1100;
        gzip_buffers     4 8k;
        gzip_types       text/plain;
        output_buffers   1 32k;
        postpone_output 1460;
     
          upstream www.hnjzjx.org {
            server 127.0.0.1:8080;
        }
     
          upstream zu1{
            server 127.0.0.1:805;
        }
     
     
        server {
            listen       80;
            server_name www.hnjzjx.org;
            #charset koi8-r;
            access_log logs/host.access.log main;
            location / {
                #root   html;
                #index index.html index.htm;
               proxy_pass http://localhost:8080;
                 include proxy.conf;
            }
       }
     
        server {
            listen       80  default_server;
            #server_name "" ;
            #charset koi8-r;
            access_log logs/host.access.log main;
            location / {
                #root   html;
                #index index.html index.htm;
                proxy_pass http://localhost:805; 
       
                include    proxy.conf;
            }
        }
    }
     
  • 相关阅读:
    当我有一台服务器时我做了什么
    git 安装及基本配置
    关于大厂面试中问到的二十几个 HTTP 面试题
    日问周刊 | 全栈面试汇总 | 第七期
    dockerfile 最佳实践及示例
    面试官:如果 http 响应头中 ETag 值改变了,是否意味着文件内容一定已经更改
    Nginx 反向代理时获取用户的真实 IP
    Go 语言实现 HTTP 层面的反向代理
    Go 语言中的 Http 路由基础
    Json Schema
  • 原文地址:https://www.cnblogs.com/MyKingDragon/p/4206955.html
Copyright © 2020-2023  润新知