-
-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configured Nginx as a reverse proxy and load balancer for Docker Comp…
…ose setup in Helpdesk sample Cofigured it fully with Swagger and other Kestrel quirks
- Loading branch information
1 parent
ad4b01c
commit 91de5b3
Showing
6 changed files
with
90 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
**/obj/ | ||
**/out/ | ||
**/TestResults/ | ||
**/Internal/Generated | ||
**/Internal/ | ||
Dockerfile |
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
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,40 @@ | ||
version: "3.8" | ||
services: | ||
nginx: | ||
restart: always | ||
image: nginx:alpine | ||
ports: | ||
- 8089:80 | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/nginx.conf | ||
# - ./nginx.conf:/etc/nginx/conf.d/default.conf | ||
depends_on: | ||
- backend | ||
|
||
backend: | ||
build: | ||
dockerfile: Dockerfile | ||
context: . | ||
args: | ||
project_name: Helpdesk.Api | ||
run_codegen: true | ||
deploy: | ||
replicas: 3 | ||
depends_on: | ||
postgres: | ||
condition: service_healthy | ||
restart: always | ||
|
||
postgres: | ||
image: postgres:15.1-alpine | ||
container_name: postgres | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U postgres"] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
environment: | ||
- POSTGRES_DB=postgres | ||
- POSTGRES_PASSWORD=Password12! | ||
ports: | ||
- "5432:5432" |
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,26 @@ | ||
worker_processes auto; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
map $http_connection $connection_upgrade { | ||
"~*Upgrade" $http_connection; | ||
default keep-alive; | ||
} | ||
|
||
server { | ||
listen 80; | ||
location / { | ||
proxy_pass http://backend:5248/; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection $connection_upgrade; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} | ||
} |