From 9d749e0b10d4d7aa3ceb5cd0b1dde2ff064e1c12 Mon Sep 17 00:00:00 2001 From: "Ozcan Aytac; Insylva project" Date: Tue, 30 Jun 2020 17:32:09 +0200 Subject: [PATCH] bug fixing-- --- login/build.sh | 2 -- portal/build.sh | 2 +- portal/nginx/nginx.conf | 14 ++++++++++++-- portal/nginx/nginx_generic.conf | 12 +++++++++++- search/.env | 2 +- search/nginx/nginx.conf | 4 ++-- search/nginx/nginx_generic.conf | 2 +- 7 files changed, 28 insertions(+), 10 deletions(-) diff --git a/login/build.sh b/login/build.sh index 5acdcbc..d52b006 100644 --- a/login/build.sh +++ b/login/build.sh @@ -7,8 +7,6 @@ while [ "$1" != "" ]; do shift done - - docker build --no-cache --build-arg SSH_KEY="$SSH_KEY" --build-arg SSH_KEY_PASSPHRASE="$SSH_KEY_PASSPHRASE" \ --build-arg MODE_ENV="production" \ --build-arg IN_SYLVA_CLIENT_ID="in-sylva.user.app" \ diff --git a/portal/build.sh b/portal/build.sh index 026e28c..1961175 100644 --- a/portal/build.sh +++ b/portal/build.sh @@ -8,4 +8,4 @@ while [ "$1" != "" ]; do done # docker build --build-arg SSH_KEY="$SSH_KEY" --build-arg SSH_KEY_PASSPHRASE="$SSH_KEY_PASSPHRASE" --tag in-sylva.portal ./portal/. -docker build --no-cache --build-arg SSH_KEY="$SSH_KEY" --build-arg SSH_KEY_PASSPHRASE="$SSH_KEY_PASSPHRASE" --tag in-sylva.portal ./portal/. +# docker build --no-cache --build-arg SSH_KEY="$SSH_KEY" --build-arg SSH_KEY_PASSPHRASE="$SSH_KEY_PASSPHRASE" --tag in-sylva.portal ./portal/. diff --git a/portal/nginx/nginx.conf b/portal/nginx/nginx.conf index 1abdd8e..b05d889 100644 --- a/portal/nginx/nginx.conf +++ b/portal/nginx/nginx.conf @@ -3,7 +3,7 @@ # load_module modules/ngx_stream_js_module.so; # load_module modules/ngx_http_geoip_module.so; -# resolver 127.0.0.1 [::]; +resolver 127.0.0.1 [::]; upstream backend_gatekeeper { hash $remote_addr$remote_port consistent; @@ -34,7 +34,7 @@ server { listen 3000; listen [::]:3000; - server_name w3.avignon.inra.fr/bas_insylva//portal/; + server_name w3.avignon.inra.fr/bas_insylva/portal/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; @@ -73,6 +73,10 @@ server { client_max_body_size 200M; } + location /static/media/ { + try_files $uri /usr/share/nginx/html/static/media; + } + location / { # js_content hello; @@ -88,6 +92,12 @@ server { } try_files $uri $fallback_file; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin: $http_origin'); add_header 'Access-Control-Allow-Origin: GET, POST, DELETE, PUT, PATCH, OPTIONS'); diff --git a/portal/nginx/nginx_generic.conf b/portal/nginx/nginx_generic.conf index a500aa4..66c493f 100644 --- a/portal/nginx/nginx_generic.conf +++ b/portal/nginx/nginx_generic.conf @@ -3,7 +3,7 @@ # load_module modules/ngx_stream_js_module.so; # load_module modules/ngx_http_geoip_module.so; -# resolver 127.0.0.1 [::]; +resolver 127.0.0.1 [::]; upstream backend_gatekeeper { hash $remote_addr$remote_port consistent; @@ -73,6 +73,10 @@ server { client_max_body_size 200M; } + location /static/media/ { + try_files $uri /usr/share/nginx/html/static/media; + } + location / { # js_content hello; @@ -88,6 +92,12 @@ server { } try_files $uri $fallback_file; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin: $http_origin'); add_header 'Access-Control-Allow-Origin: GET, POST, DELETE, PUT, PATCH, OPTIONS'); diff --git a/search/.env b/search/.env index b2ed1ab..624eb50 100644 --- a/search/.env +++ b/search/.env @@ -2,7 +2,7 @@ REACT_APP_IN_SYLVA_GATEKEEPER_HOST=/bas_insylva/search/gatekeeper REACT_APP_IN_SYLVA_SOURCE_MANAGER_HOST=/bas_insylva/search/source-manager REACT_APP_IN_SYLVA_KEYCLOAK_HOST=/bas_insylva/search/keycloak REACT_APP_IN_SYLVA_SEARCH_HOST=/bas_insylva/search/search-api -REACT_APP_IN_SYLVA_LOGIN_HOST=http://w3.avignon.inra.fr/bas_insylva/login/ +REACT_APP_IN_SYLVA_LOGIN_HOST=http://w3.avignon.inra.fr/bas_insylvalogin/ REACT_APP_IN_SYLVA_CLIENT_ID=in-sylva.user.app REACT_APP_IN_SYLVA_GRANT_TYPE=password REACT_APP_IN_SYLVA_REALM=in-sylva diff --git a/search/nginx/nginx.conf b/search/nginx/nginx.conf index 5769a7d..5af0d8d 100644 --- a/search/nginx/nginx.conf +++ b/search/nginx/nginx.conf @@ -32,7 +32,7 @@ server { listen 3001; listen [::]:3001; - server_name w3.avignon.inra.fr/bas_insylva//search/; + server_name w3.avignon.inra.fr/bas_insylva/search/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; @@ -94,7 +94,7 @@ server { # try_files $uri /bas_insylva/search/static/media/; #} location / { - # include /etc/nginx/mime.types; + # if ($arg_token ~ "^$") { return 404; } # set $token $arg_token; diff --git a/search/nginx/nginx_generic.conf b/search/nginx/nginx_generic.conf index 0f8a7ee..c965d9a 100644 --- a/search/nginx/nginx_generic.conf +++ b/search/nginx/nginx_generic.conf @@ -94,7 +94,7 @@ server { # try_files $uri /bas_insylva/search/static/media/; #} location / { - # include /etc/nginx/mime.types; + # if ($arg_token ~ "^$") { return 404; } # set $token $arg_token;