diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2023-06-27 10:13:52 +0000 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2023-06-27 10:13:52 +0000 |
commit | 4fbefba274ae89c76b12ac0b1c52063b668fc99f (patch) | |
tree | 1c66767d2e8d9b5bb14b088d631e4fceba0212fc /server | |
parent | 61189a0932dc791b92c5f2c6bbf900910f2f5861 (diff) |
Make ui nginx startup independent from proxied services
Issue-ID: PORTALNG-11
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Change-Id: Id60edf3691f285d731b998732577450a6f7648fe
Diffstat (limited to 'server')
-rw-r--r-- | server/nginx.template | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/server/nginx.template b/server/nginx.template index 98798bc..2b8edd0 100644 --- a/server/nginx.template +++ b/server/nginx.template @@ -2,10 +2,8 @@ log_format onap_logging '"$request_body"'; lua_package_path '/usr/local/openresty/lualib/?.lua;;'; - # cache for discovery metadata documents lua_shared_dict discovery 1m; - # cache for JWKs lua_shared_dict jwks 1m; @@ -14,7 +12,7 @@ resolver ${CLUSTER_NAMESERVER_IP}; error_log logs/error.log error; -server { # simple reverse-proxy +server { listen ${NGINX_PORT}; location / { @@ -24,21 +22,25 @@ server { # simple reverse-proxy } location /api/ { + set $upstream ${BFF_URL}; + rewrite /api/(.*) /$1 break; add_header Access-Control-Allow-Origin *; - proxy_pass ${BFF_URL}/; - proxy_http_version 1.1; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Server $host; - proxy_set_header X-Forwarded-Port $server_port; - proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass $upstream/$1$is_args$args; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header X-Forwarded-Port $server_port; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_http_version 1.1; } location /auth/ { + set $upstream ${KEYCLOAK_INTERNAL_URL}; + rewrite /auth/(.*) /$1 break; add_header Access-Control-Allow-Origin *; - proxy_pass ${KEYCLOAK_INTERNAL_URL}/auth/; + proxy_pass $upstream/$1$is_args$args; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; @@ -98,9 +100,7 @@ server { # simple reverse-proxy ## # Gzip Settings ## - gzip on; - gzip_vary on; gzip_proxied any; gzip_min_length 1100; |