Home How to set a simple reverse proxy with nginx
Post
Cancel

How to set a simple reverse proxy with nginx

Add a new server block

1
sudo vim /etc/nginx/sites-enabled/yourdomain.com

Add the following content

1
2
3
4
5
6
7
8
9
10
server {
    listen 80;
    listen [::]:80
    server_name yourdomain.com; # or _ if you want to listen to all domains
    location / {
        proxy_pass http://localhost:3000;
        proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header Host $http_host;
    }
}
This post is licensed under CC BY 4.0 by the author.

Data structure min binary heap

How to use nginx to setup https with certbot and let's encrypt