Samesite - proxy that can cache partial transfers

Hex Artifact Content
anonymous

Hex Artifact Content

Artifact 344dc36668f0d0bec007362228fe15b1468996114a5571d9ff3de170d31ed634:


0000: 23 20 73 61 6d 70 6c 65 20 6e 67 69 6e 78 20 63  # sample nginx c
0010: 6f 6e 66 69 67 20 74 6f 20 73 65 72 76 65 20 74  onfig to serve t
0020: 68 65 20 6c 6f 63 61 6c 20 73 69 74 65 0a 0a 6d  he local site..m
0030: 61 70 20 24 72 65 71 75 65 73 74 5f 6d 65 74 68  ap $request_meth
0040: 6f 64 3a 24 69 73 5f 61 72 67 73 20 24 68 69 6a  od:$is_args $hij
0050: 61 63 6b 5f 72 6f 6f 74 20 7b 0a 09 47 45 54 3a  ack_root {..GET:
0060: 20 2f 68 6f 6d 65 2f 61 72 63 61 64 65 2f 77 77   /home/arcade/ww
0070: 77 3b 0a 0a 09 64 65 66 61 75 6c 74 20 2f 76 61  w;...default /va
0080: 72 2f 65 6d 70 74 79 3b 0a 7d 0a 0a 73 65 72 76  r/empty;.}..serv
0090: 65 72 20 7b 0a 09 6c 69 73 74 65 6e 20 2a 3a 38  er {..listen *:8
00a0: 30 3b 0a 09 6c 69 73 74 65 6e 20 5b 66 65 63 30  0;..listen [fec0
00b0: 3a 3a 31 5d 3a 38 30 3b 0a 09 73 65 72 76 65 72  ::1]:80;..server
00c0: 5f 6e 61 6d 65 20 5e 28 3f 3c 64 6f 6d 61 69 6e  _name ^(?<domain
00d0: 3e 2e 2b 29 2e 68 69 6a 61 63 6b 3b 0a 09 61 63  >.+).hijack;..ac
00e0: 63 65 73 73 5f 6c 6f 67 20 2f 76 61 72 2f 6c 6f  cess_log /var/lo
00f0: 67 2f 6e 67 69 6e 78 2f 73 69 74 65 5f 6e 61 6d  g/nginx/site_nam
0100: 65 2e 61 63 63 65 73 73 2e 6c 6f 67 3b 0a 09 65  e.access.log;..e
0110: 72 72 6f 72 5f 6c 6f 67 20 2f 76 61 72 2f 6c 6f  rror_log /var/lo
0120: 67 2f 6e 67 69 6e 78 2f 73 69 74 65 5f 6e 61 6d  g/nginx/site_nam
0130: 65 2e 65 72 72 6f 72 2e 6c 6f 67 20 64 65 62 75  e.error.log debu
0140: 67 3b 0a 09 65 78 70 69 72 65 73 20 2d 31 3b 0a  g;..expires -1;.
0150: 09 74 72 79 5f 66 69 6c 65 73 20 24 75 72 69 20  .try_files $uri 
0160: 40 62 72 65 61 6b 3b 0a 09 65 72 72 6f 72 5f 70  @break;..error_p
0170: 61 67 65 20 34 30 34 20 3d 20 40 62 72 65 61 6b  age 404 = @break
0180: 3b 0a 09 6c 6f 67 5f 6e 6f 74 5f 66 6f 75 6e 64  ;..log_not_found
0190: 20 6f 66 66 3b 0a 09 23 20 61 75 74 6f 69 6e 64   off;..# autoind
01a0: 65 78 20 6f 6e 3b 0a 0a 09 6c 6f 63 61 74 69 6f  ex on;...locatio
01b0: 6e 20 2f 20 7b 0a 09 09 72 6f 6f 74 20 24 68 69  n / {...root $hi
01c0: 6a 61 63 6b 5f 72 6f 6f 74 2f 24 64 6f 6d 61 69  jack_root/$domai
01d0: 6e 3b 0a 09 7d 0a 0a 09 6c 6f 63 61 74 69 6f 6e  n;..}...location
01e0: 20 40 62 72 65 61 6b 20 7b 0a 09 09 23 20 70 6f   @break {...# po
01f0: 69 6e 74 69 6e 67 20 6f 75 74 20 77 68 65 72 65  inting out where
0200: 20 6f 75 72 20 73 65 72 76 65 72 20 6c 69 73 74   our server list
0210: 65 6e 73 0a 09 09 70 72 6f 78 79 5f 70 61 73 73  ens...proxy_pass
0220: 20 68 74 74 70 3a 2f 2f 6c 6f 63 61 6c 68 6f 73   http://localhos
0230: 74 3a 38 30 30 38 3b 0a 09 09 23 20 73 61 79 69  t:8008;...# sayi
0240: 6e 67 20 74 68 61 74 20 77 65 20 64 6f 77 6e 6c  ng that we downl
0250: 6f 61 64 69 6e 67 20 66 72 6f 6d 20 72 65 61 6c  oading from real
0260: 20 73 69 74 65 0a 09 09 70 72 6f 78 79 5f 73 65   site...proxy_se
0270: 74 5f 68 65 61 64 65 72 20 48 6f 73 74 20 24 64  t_header Host $d
0280: 6f 6d 61 69 6e 3b 0a 09 09 70 72 6f 78 79 5f 72  omain;...proxy_r
0290: 65 61 64 5f 74 69 6d 65 6f 75 74 20 36 30 30 3b  ead_timeout 600;
02a0: 0a 09 7d 0a 7d 0a                                ..}.}.