My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Proxy not working on react after running npm run build

sadiq mustapha aji's photo
sadiq mustapha aji
·Mar 23, 2019

Hi! I deployed my react project on digital ocean (ubuntu). In development am making fetch request to my backend server that's also hosted on the digital ocean (same O.s with frontend App). I added proxy: ip:port in the package.json file. And that is working perfectly fine, but after running npm run build the request is using domain instead of backendipadress. Suppose (real.com) is domain and ipaddress:5000 my server if make the request instead of ipaddress:5000 the request is redirecting to real.com. Am using nginx for reverse proxy