Setting up react and nodejs servers on same machine

Viewed 18

I am setting up a reactjs application on port 3000 as well as a nodejs API server on port 3500 on the same box on the internet. Assume the box has a domain name example.com, and I am using nginx in reverse proxy to receive the end users over https, and internally direct it to the port 3000 of the reactjs server. On the react code, while calling axios API for a get command, which of the following should I be using:

Few tests I did:

  • Access from my browser the reactjs application successfully as example.com (nginx does the mapping to port 3000)
  • Using https://reqbin.com/ I was able to access the nodejs server API and get the correct result using: http://example.com:3500/users
  • Using https instead of http causes an error: SSL connection error Error code: 10035
0 Answers
Related