aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/resources/nginx/nginx_proxy_mirroring.conf
blob: 56debf5c290b6c34b043680adc7febde6887ae8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
master_process on;
worker_processes 4;
worker_rlimit_nofile 102400;
daemon off;

error_log /tmp/nginx/error.log;

events {
  use epoll;
  worker_connections 102400;
  accept_mutex off;
}

http {
  include mime.types;
  default_type application/octet-stream;

  access_log off;

  keepalive_timeout 300;
  keepalive_requests 1000000;

  proxy_connect_timeout 300;
  large_client_header_buffers 4 512k;
  client_max_body_size 3000m;
  client_header_buffer_size 2048m;
  client_body_buffer_size 1024m;
  proxy_buffers 16 10240k;
  proxy_buffer_size 10240k;

  gzip on;

  upstream bk {
    server {{.Server}}:8091;
    keepalive 30000;
  }
  upstream bk1 {
    server {{.Server}}:8092;
    keepalive 30000;
  }
  upstream bk2 {
    server {{.Server}}:8093;
    keepalive 30000;
  }

  server {
    listen 80;
    server_name {{.Proxy}};

    server_tokens off;

    proxy_redirect off;

    location / {
      root html;
      index index.html index.htm;
      proxy_pass http://bk;
      proxy_set_header Connection "";
      proxy_set_header X-Original-URI $request_uri;
      proxy_set_header Host $host:$server_port;
      chunked_transfer_encoding on;
      proxy_http_version 1.1;
      mirror /mimic1;
      mirror /mimic2;
      mirror_request_body on;
    }
    location /mimic1 {
      proxy_pass http://bk1$request_uri;
      proxy_set_header X-Original-URI $request_uri;
      proxy_set_header Connection "";
      chunked_transfer_encoding on;
      proxy_http_version 1.1;
      proxy_set_header Host $host:$server_port;
    }
    location /mimic2 {
      proxy_pass http://bk2$request_uri;
      proxy_set_header X-Original-URI $request_uri;
      proxy_set_header Host $host:$server_port;
      proxy_set_header Connection "";
      proxy_http_version 1.1;
      chunked_transfer_encoding on;
    }
  }
}