Skip to content

Commit

Permalink
adds fields for proxy timeouts, configures for bibdata and default
Browse files Browse the repository at this point in the history
Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>
  • Loading branch information
acozine and sandbergja committed Nov 3, 2023
1 parent 55d25b1 commit 4ca996c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions roles/nginxplus/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -437,3 +437,8 @@ nginx_stream_template:
nginx_server_names_hash_bucket_size: 64
nginx_server_names_hash_max_size: 1024
client_max_body_size: 0
# These values control how long nginx waits before
# re-routing slow requests to a different server
proxy_connect_timeout: 60s
proxy_send_timeout: 60s
proxy_read_timeout: 60s
6 changes: 6 additions & 0 deletions roles/nginxplus/templates/http/library.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ server {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_cache {{ item.short_name }}cache;
proxy_connect_timeout {{ item.proxy_connect_timeout }};
proxy_send_timeout {{ item.proxy_send_timeout }};
proxy_read_timeout {{ item.proxy_read_timeout }};
# handle errors using errors.conf
proxy_intercept_errors on;
# TODO don't do a health check if there's only one server
Expand All @@ -82,6 +85,9 @@ server {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_cache {{ item.short_name }}cache;
proxy_connect_timeout {{ item.proxy_connect_timeout }};
proxy_send_timeout {{ item.proxy_send_timeout }};
proxy_read_timeout {{ item.proxy_read_timeout }};
proxy_intercept_errors on;
health_check interval=10 fails=3 passes=2;
# allow princeton network
Expand Down
16 changes: 16 additions & 0 deletions roles/nginxplus/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ sites:
## client_max_body_size defines the upper limit on request sizes
## default is 0 (don't check), if you change this, you must include the unit of measurement
# client_max_body_size: 8m
## proxy timeouts default to 60 seconds
## to increase or decrease these values, set:
# proxy_connect_timeout: 2h
# proxy_send_timeout: 2h
# proxy_read_timeout: 2h
## error handling templates live in /etc/nginx/conf.d/templates/
## the default template for handling errors is errors.conf
# error_handling_template: cdh-errors.conf
Expand Down Expand Up @@ -59,6 +64,7 @@ sites:
rate_limit_mb: 10
rate_limit_per_sec: 10
rate_limit_burst_rate: 20
# error_handling_template: changeme
- name: allsearch-api-staging
servers:
- allsearch-api-staging1
Expand All @@ -68,6 +74,7 @@ sites:
lbtechnique: least_conn
client_max_body_size: 512k
app_protect: enabled
# error_handling_template: changeme

# - name: annotations-prod
# servers:
Expand Down Expand Up @@ -117,6 +124,9 @@ sites:
# location: "/"
# visibility: public
# app_protect: disabled
# proxy_connect_timeout: 2h
# proxy_send_timeout: 2h
# proxy_read_timeout: 2h
# - name: bibdata-qa
# servers:
# # - bibdata-qa1
Expand All @@ -126,6 +136,9 @@ sites:
# visibility: private
# added_restrictions: htc_restrict.conf
# app_protect: disabled
# proxy_connect_timeout: 2h
# proxy_send_timeout: 2h
# proxy_read_timeout: 2h
- name: bibdata-staging
servers:
# - bibdata-alma-staging1
Expand All @@ -136,6 +149,9 @@ sites:
added_restrictions:
- "htc_restrict.conf"
app_protect: enabled
proxy_connect_timeout: 2h
proxy_send_timeout: 2h
proxy_read_timeout: 2h
# - name: byzantine-tsp-prod
# servers:
# - byzantine-tsp-prod
Expand Down

0 comments on commit 4ca996c

Please sign in to comment.