logs
This commit is contained in:
parent
71d1b559a8
commit
b92abc036f
3 changed files with 16 additions and 0 deletions
|
|
@ -20,5 +20,6 @@ services:
|
|||
volumes:
|
||||
- ./nginx/html:/usr/share/nginx/html:ro
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./nginx/logs:/var/log/nginx
|
||||
ports:
|
||||
- "80:80"
|
||||
|
|
|
|||
1
nginx/.gitignore
vendored
Normal file
1
nginx/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
logs
|
||||
|
|
@ -1,5 +1,13 @@
|
|||
events { }
|
||||
http {
|
||||
# Connection limiting
|
||||
limit_conn_zone $binary_remote_addr zone=addr:10m;
|
||||
limit_conn addr 10; # Max 10 concurrent connections per IP
|
||||
|
||||
# Rate limiting (optional)
|
||||
limit_req_zone $binary_remote_addr zone=req_limit:10m rate=20r/s;
|
||||
limit_req zone=req_limit burst=30 nodelay;
|
||||
|
||||
upstream dotnet_app {
|
||||
server dotnet-1;
|
||||
server dotnet-2;
|
||||
|
|
@ -21,10 +29,16 @@ http {
|
|||
location / {
|
||||
proxy_pass http://$app_backend;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
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;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_set_header X-Forwarded-Port $server_port;
|
||||
}
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue