I'm trying to set a custom URL for a reverse proxy. From what I understand, the code should be fairly straight forward. Here's what I've got:
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 8080;
server_name www.example.com;
location / {
proxy_pass http://localhost:3000/;
}
}
}
Afterwards in terminal I made sure to type in the command:
sudo nginx -s reload
When I go to www.example.com I get "This site can’t be reached", but when I type "localhost:8080" into the url it successfully loads the content from localhost:3000.
What exactly am I doing wrong here?