Fix the Nginx conf to start even when Upstream is unavailable 33/5633/1
authorLathish <lathishbabu.ganesan@est.tech>
Thu, 11 Feb 2021 11:06:53 +0000 (11:06 +0000)
committerLathish <lathishbabu.ganesan@est.tech>
Thu, 11 Feb 2021 11:06:57 +0000 (11:06 +0000)
Issue-ID: NONRTRIC-367
Change-Id: Ibb9218bdb71f9d2a535d64b2677d643526c46f4f
Signed-off-by: Lathish <lathishbabu.ganesan@est.tech>
webapp-frontend/nginx.conf

index 3da6003..10f4582 100644 (file)
@@ -2,24 +2,22 @@ events{}
 
 http {
     include /etc/nginx/mime.types;
-
-    upstream backend {
-        server  nonrtric-gateway:9090;
-    }
-
+    
     server {
         listen 8080;
         server_name localhost;
         root /usr/share/nginx/html;
         index index.html;
         location /a1-policy/ {
-            proxy_pass  http://backend;
+            set $upstream http://nonrtric-gateway:9090;
+            proxy_pass  $upstream;
         }
-        location /ei-producer/ {
-            proxy_pass  http://backend;
+        location /ei-producer/{
+            set $upstream http://nonrtric-gateway:9090;
+            proxy_pass  $upstream;
         }
         location / {
-           try_files $uri $uri/ /index.html;
+            try_files $uri $uri/ /index.html;
         }
     }
 }
\ No newline at end of file