Skip to content

Instantly share code, notes, and snippets.

@Maximization
Created August 3, 2020 14:20
Embed
What would you like to do?
Basic Nginx configuration for serving multiple websites at different domains
# `events` block is required so we add an empty one for validity
events {}
http {
# Configuration block for weatherapp.com
server {
listen 80; # HTTP
server_name weatherapp.com; # match all requests originating from "weatherapp.com" domain
# Route all requests to port 3000 on localhost
location / {
proxy_pass http://localhost:3000;
}
}
# Configuration block for ecommerceapp.com
server {
listen 80; # HTTP
server_name ecommerceapp.com; # match all requests originating from "ecommerceapp.com" domain
# Route all requests to port 3001 on localhost
location / {
proxy_pass http://localhost:3001;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment