-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add load balancer for web api in docker-compose (#582)
In order to replicate the setup in Container Apps, we add a load balancer so we can have more than one replica of the web api.
- Loading branch information
Showing
2 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# this nginx config is for the load balancer: dialogporten-webapi-ingress in docker-compose.yml | ||
events {} | ||
|
||
http { | ||
upstream webapi { | ||
least_conn; | ||
server dialogporten-webapi:8080; | ||
} | ||
|
||
server { | ||
listen 80; | ||
|
||
location / { | ||
proxy_pass http://webapi; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} | ||
} |