connect new-app'd frontend to backend via proxy_pass

This commit is contained in:
Guy Bianco IV 2021-06-15 17:22:00 -04:00
parent 494ca40292
commit 2c80a284af
2 changed files with 5 additions and 16 deletions

View file

@ -3,7 +3,8 @@ FROM registry.access.redhat.com/ubi8/nodejs-14 AS appbuild
LABEL version="1.0" LABEL version="1.0"
LABEL description="To Do List application builder" 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 USER 0

View file

@ -2,8 +2,6 @@
# * Official English Documentation: http://nginx.org/en/docs/ # * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/
env BACKEND_HOST;
worker_processes auto; worker_processes auto;
error_log stderr; error_log stderr;
pid /run/nginx.pid; pid /run/nginx.pid;
@ -34,8 +32,6 @@ http {
# for more information. # for more information.
include /etc/nginx/conf.d/*.conf; include /etc/nginx/conf.d/*.conf;
perl_set $backend 'sub { return $ENV{"BACKEND_HOST"}; }';
server { server {
listen 8080 default_server; listen 8080 default_server;
listen [::]:8080 default_server; listen [::]:8080 default_server;
@ -45,21 +41,13 @@ http {
# Load configuration files for the default server block. # Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf; include /etc/nginx/default.d/*.conf;
sub_filter_types application/javascript; location /api/ {
sub_filter '_BACKEND_' $backend; proxy_pass http://todo-list:3000;
sub_filter_once off; }
location / { location / {
} }
# error_page 404 /404.html;
# location = /40x.html {
# }
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# }
} }
} }