Basic Nginx configuration for serving multiple websites at different domains
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# `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