Last active
June 8, 2020 10:59
-
-
Save nzkozar/5390d8c7ab78bcb0609e9d58f97ae183 to your computer and use it in GitHub Desktop.
A server block configuration for nginx, splitting one domain name into two locations, by listening on different ports
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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /var/www/html/A; | |
index index.html; | |
server_name localhost; | |
location / { | |
# First attempt to serve request as file, then | |
# as directory, then fall back to displaying a 404. | |
try_files $uri $uri/ =404; | |
} | |
} | |
server { | |
listen 8191; | |
listen [::]:8191 default_server; | |
root /var/www/html/B; | |
index index.html; | |
server_name localhost; | |
location / { | |
# First attempt to serve request as file, then | |
# as directory, then fall back to displaying a 404. | |
try_files $uri $uri/ =404; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment