Created
August 3, 2020 14:20
-
-
Save Maximization/44d8de53e582a4bdd093d51ad9d21eaf to your computer and use it in GitHub Desktop.
Basic Nginx configuration for serving multiple websites at different domains
This file contains hidden or 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