docker with reactjs app failing as cant find static resources

Viewed 71

I have a docker running a reactapp. In the host I have apache2 and Im proxy passing my traffic into the docker container as follows

ServerName mydomain.com
ServerAlias www.mydomain.com
ProxyPass / http://127.0.0.1:8090 connectiontimeout=6000 timeout=6000
ProxyPassReverse / http://127.0.0.1:8090

Inside I have my nginx configuration

location / {
     try_files $uri $uri/ =404;
 }
 location /static/ {
     alias /usr/share/nginx/html/static;
     index index.html;
 }

When I call my domain it correctly goes into the docker but I get:

/static/css/main.a22ae611823d42f9021f.css:1 Failed to load resource: the server responded with a status of 502 (Proxy Error)
bundle.a22ae611823d42f9021f.js:1 Failed to load resource: the server responded with a status of 502 (Proxy Error)
bundle.a22ae611823d42f9021f.js:1 Failed to load resource: the server responded with a status of 502 (Proxy Error)

How can I ensure it directs the requests inward for my static resources?

Thanks

0 Answers
Related