简体   繁体   中英

Deploying react apps to custom domain name (Ubuntu)

My react app is installed on a ubuntu server. I want to add a custom domain to it. When I pointed the domain to the server. It points to xx.xx.xx.xx but the react app is installed on xx.xx.xx.xx:3000

How can I install the react app on xx:xx:xx:xx:80?

Does your app still works with example.com:3000 ? I believe it should.

Your web server's port needs to be on 80 to serve with http://example.com/ or http://xx.xx.xx.xx/ . Either change the port to 80, or use a web server such as Nginx to proxy 80 to your 3000.

React App doesn't run in port 80 . So we need to redirect requests hitting port 80 to port 3000 .

For this, You need Nginx server which helps you with this.

Follow these Steps and Your react app will work on Port 80.

Link https://www.digitalocean.com/community/tutorials/how-to-deploy-a-react-application-with-nginx-on-ubuntu-20-04

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM