Created
November 21, 2019 12:42
-
-
Save antunesleo/eec085175f40601f61825a7ae070e5d8 to your computer and use it in GitHub Desktop.
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
# With this, when you proxy_pass to all-apis, nginx automically will balance the requests between the servers. | |
upstream all-apis { | |
server your-ip-here:5000; | |
server another-ip-here:5000; | |
server a-third-ip-here:5000; | |
} | |
server { | |
listen 80; | |
client_max_body_size 600M; | |
server_name yoursite.example.com; | |
root /yoursite/www; | |
index index.html; | |
location / { | |
} | |
location /api { | |
# other configs... | |
proxy_pass http://all-apis; # passing the requests for one of the servers define above | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment