'Cannot Access Bud .serve URL (http://localhost:3000/) via Windows Host, Despite Reverse Proxy of Port 3000 Out of Devilbox PHP Container

I run the following command within my Roots Sage 10 theme directory, whilst inside a Devilbox Shell / Docker Container on Windows WSL.

yarn dev

My proxy url works fine. My server url says "localhost refused to connect". I'm expecting my server url to deliver the same website, but auto update with development changes.

I've tried setting up a Reverse Proxy for Port 3000 as per the link below, but I still get the same error. https://devilbox.readthedocs.io/en/latest/reverse-proxy/reverse-proxy-with-https.html I can see the funnel next to my vhost and when I check the config, I can see the following.

proxy_pass http://php:3000;

Not only does my server url still have the same error, my proxy url now says "502 Bad Gateway".

I wasn't sure if I should be leaving php as it is or changing that to say localhost. According to the link below, it should stay as PHP "Node projcet hostname: php (will always be php)" https://github.com/cytopia/devilbox/issues/240 This seems to contradict someone else's solution...

proxy_pass http://172.16.238.1:3000;

Taken from... https://gist.github.com/stkrzysiak/7892ab681ca826046bb8b66ccfd6c4ce The comment to leave as php is most recent though, so I'm leaving it as that for now. I've tried many combinations, including making changes to my bud.config.js file. Current settings...

.proxy('http://kwd-it.loc')
.serve('http://localhost:3000');

If anyone can offer any assistance, it would be greatly appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source