nginx server配置

server {
listen 80;
server_name XXX.XXX.com;

  location /{
      proxy_pass http://127.0.0.1:8082/;
      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_max_body_size 10m;
      client_body_buffer_size 256k;
      proxy_connect_timeout 20;
      proxy_send_timeout 20;
      proxy_read_timeout 20;
      proxy_buffer_size 256k;
      proxy_buffers 4 256k;
      proxy_busy_buffers_size 512k;
      proxy_temp_file_write_size 512k;
  }
  location ^~/esports-mainstage {
      proxy_pass http://127.0.0.1:8098;
      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_max_body_size 10m;
      client_body_buffer_size 256k;
      proxy_connect_timeout 20;
      proxy_send_timeout 20;
      proxy_read_timeout 20;
      proxy_buffer_size 256k;
      proxy_buffers 4 256k;
      proxy_busy_buffers_size 512k;
      proxy_temp_file_write_size 512k; 
  }
}
server {
        listen       80;
        server_name  html.lichenyi.cn;

        location /newyear/ {
            root   html;
            index  index.html index.htm;
        }

        location /ndsd/ {
            root   html;
            index  index.html index.htm;
        }

        location /less/ {
            root   html;
            index  index.html index.htm;
        }
    }

    root:则是指定目录某个目录的父目录,如:
    locate /less/ {
        root html;
    }
    那么在/html/目录下必须有一个less目录,否则报错.

你可能感兴趣的:(linux,技术,nginx,Linux)