Skip to content

Commit

Permalink
added PROXY_READ_TIMEOUT env var for nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
bcrickboom committed Aug 7, 2024
1 parent f251d98 commit 0136c6c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion sources/README-dockerhub-orthanc-nginx.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ Web service to run in front of Orthanc to handle sharing of studies & admin inte
| ENABLE_ORTHANC_FOR_API | false | Access to Orthanc for api (e.g. for DicomWeb clients or scripts) | `/orthanc-api/` | `http://orthanc-for-api:8042` |
| ENABLE_ORTHANC_FOR_SHARES | false | Access to Orthanc for shares (publication links). This is required only if you are not using keycloak and are enabling shares. | `/shares/` | `http://orthanc-for-shares:8042` |
| ENABLE_OHIF | false | Access to OHIF viewer | `/ohif/` | `http://ohif:80` |
| ENABLE_HTTPS | false | Enables HTTPS | NA | NA |


| Environment variable | Default value | Description |
|----------------------------|:-------------------------|:----------------------------------------------------------------------------------------------------------------|
| ENABLE_HTTPS | false | Enables HTTPS |
| PROXY_READ_TIMEOUT | 60 | Nginx `proxy_read_timeout` variable (s) |

If `ENABLE_HTTPS` is set to `true`, you must also provide a certificate file in `/etc/nginx/tls/crt.pem` and a private key in `/etc/nginx/tls/key.pem`.

Expand Down
4 changes: 4 additions & 0 deletions sources/nginx/copy-conf-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ enableOrthancTokenService="${ENABLE_ORTHANC_TOKEN_SERVICE:-false}"
enableOhif="${ENABLE_OHIF:-false}"
enableMedDream="${ENABLE_MEDDREAM:-false}"

# manage proxy_read_timeout value
proxy_read_timeout="${PROXY_READ_TIMEOUT:-60}"
sed -i "s/proxy_read_timeout_placeholder/${proxy_read_timeout}s/g" /etc/nginx/includes/nginx-common.conf

ls -al /etc/nginx/disabled-reverse-proxies/

if [[ $enableOrthanc == "true" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion sources/nginx/nginx-common.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: CC0-1.0

# To avoid 504 error when uploading big files
proxy_read_timeout 600s;
proxy_read_timeout proxy_read_timeout_placeholder;

# To avoid "too big header... / 502 Bad Gateway" error (inspired from https://www.getpagespeed.com/server-setup/nginx/tuning-proxy_buffer_size-in-nginx)
proxy_buffer_size 32k;
Expand Down

0 comments on commit 0136c6c

Please sign in to comment.