Home > other >  Deploying react apps to custom domain name (Ubuntu)
Deploying react apps to custom domain name (Ubuntu)

Time:02-11

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 ?

CodePudding user response:

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.

CodePudding user response:

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

  • Related