@@ -6,6 +6,12 @@ gzip_min_length 1000;
6
6
gzip_proxied any;
7
7
gzip_types application/json application/javascript text/css text/javascript;
8
8
9
+ # Increase client max body size to allow for larger uploads
10
+ client_max_body_size 20m;
11
+
12
+ # Increase proxy headers hash size due to our use of proxy_set_header - as per nginx msg in log.
13
+ proxy_headers_hash_max_size 1024;
14
+
9
15
# Convenience map to specify caching expiry by request type (use in expires directive as below)
10
16
map $sent_http_content_type $expires {
11
17
default off;
@@ -16,9 +22,6 @@ map $sent_http_content_type $expires {
16
22
text/html epoch;
17
23
}
18
24
19
- # Increase client max body size to allow for larger uploads
20
- client_max_body_size 20m;
21
-
22
25
# Set $is_desktop and $is_mobile variables for simple UA-based sniffing.
23
26
# This was snagged from https://gist.github.com/perusio/1326701 and is not guaranteed by any means
24
27
# to be perfect or exhaustive. Apps should use with care - we can tune if we have real-world cases
@@ -35,6 +38,19 @@ map $is_desktop $is_mobile {
35
38
0 1;
36
39
}
37
40
41
+ # Set new $xh_jespa_connection_id for use in xh-proxy include, where the resulting value is
42
+ # used to add/replace a Jespa-Connection-Id header. If request arrives with a Jespa-Connection-Id
43
+ # header already set, this map will re-use that same value: the incoming header is assumed to
44
+ # have been set by an upstream proxy or k8s ingress and to contain the actual client addr and port.
45
+ # Otherwise, we create the ID with the addr and port we know about here.
46
+ map $http_jespa_connection_id $xh_jespa_connection_id {
47
+ volatile;
48
+ default $http_jespa_connection_id;
49
+
50
+ "" $remote_addr:$remote_port;
51
+ }
52
+
53
+
38
54
# App-level Dockerfiles must copy in an appropriate conf with server directives such as the below.
39
55
40
56
#server {
0 commit comments