From 2c80a284afd26a8944f58773f9466e0878a3a767 Mon Sep 17 00:00:00 2001 From: Guy Bianco IV Date: Tue, 15 Jun 2021 17:22:00 -0400 Subject: [PATCH] connect new-app'd frontend to backend via proxy_pass --- todo-frontend/Dockerfile | 3 ++- todo-frontend/nginx.conf | 18 +++--------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/todo-frontend/Dockerfile b/todo-frontend/Dockerfile index b29a961..9935c9e 100644 --- a/todo-frontend/Dockerfile +++ b/todo-frontend/Dockerfile @@ -3,7 +3,8 @@ FROM registry.access.redhat.com/ubi8/nodejs-14 AS appbuild LABEL version="1.0" LABEL description="To Do List application builder" -ENV REACT_APP_API_HOST=http://localhost:3000 +# ENV REACT_APP_API_HOST=http://localhost:3000 +ENV REACT_APP_API_HOST="" USER 0 diff --git a/todo-frontend/nginx.conf b/todo-frontend/nginx.conf index f0e4d7f..9b41d15 100644 --- a/todo-frontend/nginx.conf +++ b/todo-frontend/nginx.conf @@ -2,8 +2,6 @@ # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ -env BACKEND_HOST; - worker_processes auto; error_log stderr; pid /run/nginx.pid; @@ -34,8 +32,6 @@ http { # for more information. include /etc/nginx/conf.d/*.conf; - perl_set $backend 'sub { return $ENV{"BACKEND_HOST"}; }'; - server { listen 8080 default_server; listen [::]:8080 default_server; @@ -45,21 +41,13 @@ http { # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; - sub_filter_types application/javascript; - sub_filter '_BACKEND_' $backend; - sub_filter_once off; + location /api/ { + proxy_pass http://todo-list:3000; + } location / { } -# error_page 404 /404.html; -# location = /40x.html { -# } - -# error_page 500 502 503 504 /50x.html; -# location = /50x.html { -# } - } }