From ea90b1a1f5f60ef65fbe2e8499ee5f592f2700be Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Tue, 22 Sep 2020 15:39:04 +0300 Subject: [PATCH] configured proxy for nginx --- docker/common/nginx/nginx.conf.template | 76 +++++++++++++------------ docker/red-ui/docker-entrypoint.sh | 10 +++- 2 files changed, 50 insertions(+), 36 deletions(-) diff --git a/docker/common/nginx/nginx.conf.template b/docker/common/nginx/nginx.conf.template index 1d40db982..eb6680ea8 100644 --- a/docker/common/nginx/nginx.conf.template +++ b/docker/common/nginx/nginx.conf.template @@ -1,37 +1,43 @@ -server { - listen 8080; - proxy_hide_header WWW-Authenticate; - root /usr/share/nginx/html; - location / { - index index.html; - expires -1; - proxy_hide_header WWW-Authenticate; - try_files $uri$args $uri$args/ $uri $uri/ /index.html =404; - } - location /project { - proxy_pass $API_URL - } - location /reanalyse { - proxy_pass $API_URL +http { + server { + listen 8080; + proxy_hide_header WWW-Authenticate; + root /usr/share/nginx/html; + location / { + index index.html; + expires -1; + proxy_hide_header WWW-Authenticate; + try_files $uri$args $uri$args/ $uri $uri/ /index.html =404; + } + location /project { + proxy_pass $API_URL; + } + location /reanalyse { + proxy_pass $API_URL; + } + location /upload { + proxy_pass $API_URL; + } + location /download { + proxy_pass $API_URL; + } + location /delete { + proxy_pass $API_URL; + } + location /status { + proxy_pass $API_URL; + } + gzip_min_length 1000; + gzip on; + gzip_http_version 1.0; + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_types application/javascript text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; } - location /upload { - proxy_pass $API_URL - } - location /download { - proxy_pass $API_URL - } - location /delete { - proxy_pass $API_URL - } - location /status { - proxy_pass $API_URL - } - gzip_min_length 1000; - gzip on; - gzip_http_version 1.0; - gzip_vary on; - gzip_proxied any; - gzip_comp_level 6; - gzip_buffers 16 8k; - gzip_types application/javascript text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; +} + +events { + # configuration of connection processing } diff --git a/docker/red-ui/docker-entrypoint.sh b/docker/red-ui/docker-entrypoint.sh index 54c2f5555..f8b2f9314 100755 --- a/docker/red-ui/docker-entrypoint.sh +++ b/docker/red-ui/docker-entrypoint.sh @@ -12,4 +12,12 @@ echo '{ "API_URL":"'"$API_URL"'" }' > /usr/share/nginx/html/assets/config/config.json -envsubst '$API_URL' < /nginx.conf.template > /etc/nginx/nginx.conf && exec nginx -g 'daemon off;' +envsubst '$API_URL' < /nginx.conf.template > /etc/nginx/nginx.conf + +cho 'Env variables: ' +cat /usr/share/nginx/html/assets/config/config.json + +echo 'Running with config: ' +cat /etc/nginx/nginx.conf + +nginx -g 'daemon off;'