Skip to content

Instantly share code, notes, and snippets.

@Maximization
Created August 3, 2020 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Maximization/44d8de53e582a4bdd093d51ad9d21eaf to your computer and use it in GitHub Desktop.
Save Maximization/44d8de53e582a4bdd093d51ad9d21eaf to your computer and use it in GitHub Desktop.
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