From 2946f603e4fdb1eb078918adbe0e5c88ff8c247a Mon Sep 17 00:00:00 2001 From: toulemonde <toulemonde@sandbox97.cines.fr> Date: Mon, 20 Dec 2021 15:02:57 +0100 Subject: [PATCH] chnage config --- Dockerfile | 2 +- nginx/default.conf | 77 ++++++++++++++++++++++++---------------------- nginx/start.sh | 1 - public/config.js | 3 +- 4 files changed, 43 insertions(+), 40 deletions(-) diff --git a/Dockerfile b/Dockerfile index 58fc8b79..f7850077 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ COPY nginx/default.conf /etc/nginx/conf.d/default.conf COPY nginx/start.sh /start.sh COPY src src -COPY dist /usr/share/nginx/html +COPY dist /usr/share/nginx/html/app ARG fdp_app ENV APP=$fdp_app diff --git a/nginx/default.conf b/nginx/default.conf index 7b917704..a462351c 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -1,5 +1,5 @@ upstream fdp-api { - server 10.3.148.245; + server 146.59.2.80; } server { @@ -10,42 +10,45 @@ server { location / { - set $should_proxy 1; - - # Client html - if ($http_accept ~ '(text/html)') { - set $should_proxy 0; - } - - # Client assets - if ($request_uri ~ '(\.css)|(\.png)|(\.js)|(\.ico)$') { - set $should_proxy 0; - } - - # RDF API - if ($request_uri ~ '(\?format=(.+))$') { - set $should_proxy 1; - } - - # Swagger - if ($request_uri ~ '(swagger-ui\.html)') { - set $should_proxy 1; - } - - # Swagger assets - if ($request_uri ~ '^(/webjars)') { - set $should_proxy 1; - } - - if ($should_proxy) { - proxy_pass http://fdp-api; - break; - } - - root /usr/share/nginx/html; - add_header Last-Modified ""; - index index.html index.htm; - } + + + set $should_proxy 1; + + + # Client html + if ($http_accept ~ '(text/html)') { + set $should_proxy 0; + } + + # Client assets + if ($request_uri ~ '(\.css)|(\.png)|(\.js)|(\.ico)$') { + set $should_proxy 0; + } + + # RDF API + if ($request_uri ~ '(\?format=(.+))$') { + set $should_proxy 1; + } + + # Swagger + if ($request_uri ~ '^(/swagger-ui\.html)|(/swagger-ui/)|(/v3/api-docs)') { + set $should_proxy 1; + } + + # Swagger assets + if ($request_uri ~ '^(/webjars)') { + set $should_proxy 1; + } + + if ($should_proxy) { + proxy_pass http://fdp-api; + break; + } + + root /usr/share/nginx/html; + add_header Last-Modified ""; + index index.html index.htm; + } error_page 500 502 503 504 /50x.html; location = /50x.html { diff --git a/nginx/start.sh b/nginx/start.sh index 9d581582..0742aafe 100755 --- a/nginx/start.sh +++ b/nginx/start.sh @@ -5,5 +5,4 @@ #sed -i "s#\$FDP_API_SERVICE_HOST#"$FDP_API_SERVICE_HOST"#g" /usr/share/nginx/html/config.js #sed -i "s#\$FDP_API_SERVICE_HOST#"$FDP_API_SERVICE_HOST"#g" /usr/share/nginx/html/app/config.js - nginx -g 'daemon off;' diff --git a/public/config.js b/public/config.js index 5a390e66..aa71feec 100644 --- a/public/config.js +++ b/public/config.js @@ -1,4 +1,5 @@ window.config = { publicPath: '', - apiURL: 'http://fdp-api.f2ds.svc.cluster.local/' + apiURL: 'http://146.59.2.80' } + -- GitLab