nginx-http之配置结构(一)

配置结构

   upstream multibackend {
        172.19.58.22:12256
        172.19.58.21:12256
        172.19.58.23:12256
   }

   upstream masterbackend {
        172.19.58.26:12256
   }

   http {
         ...
         server {
              listen port;
              server_name xx;

              location = a {
                 ...
              }
              location ~ b {
                 ...
              }
          }      

         server {
              listen port;
              server_name xx;
              location = a {
                 ...
              }
              location ~ b {
                 ...
              }
          } 
         server {
              listen port;
              server_name xx;
              location = a {
                 proxy_pass http://masterbackend;
              }
              location ~ b {
                 proxy_pass http://multibackend;
              }
               ...
          }   
       
   }   

  [http , server]
  client_header_timeout 60s; // 408响应码【Request Time-Out】
  client_body_timeout   60s; // 408响应码【Request Time-Out】

  [http , server , location]
  client_max_body_size  1024M;// 接口上传的时候文件体过大时,413响应码【Request Entity Too Large】

  [http, server, location, if in location] 
  error_page code ... [=[response] ]uri;
原文地址:https://www.cnblogs.com/pengsn/p/13671512.html