I have a express server on my Linode running, how do I add nginx for the static website?

I currently have an express server running on my Linode. I would now like to host a static React website using nginx. I'm a little confused though.

Currently the IP address is mapped to express routes on my API eg. xx.xxx.xxx.xxx/some_route

I setup port forwarding from 3000 express to 8000 the web like so:

sudo iptables -A PREROUTING -t nat -i eth0 -p tcp — dport 80 -j REDIRECT — to-port 3000
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp — dport 443 -j REDIRECT — to-port 8000

How will my website work if the IP address is already being mapped to the express API?

1 Reply

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct