generated from nginxinc/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f72cfef
commit 2f64a1e
Showing
4 changed files
with
72 additions
and
0 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,52 @@ | ||
# NGINX Loadbalancer for K8s HTTP configuration, for L7 load balancing | ||
# Chris Akker, Oct 2023 | ||
# HTTP Proxy and load balancing | ||
# Single Cluster Load Balancing | ||
# Upstream servers managed by NLK Controller | ||
# | ||
#### single-clusters.conf | ||
|
||
# Main Nginx Server Block for cafe.example.com, with TLS | ||
|
||
server { | ||
listen 443 ssl; | ||
status_zone https://cafe.example.com; | ||
server_name cafe.example.com; | ||
|
||
ssl_certificate /etc/ssl/nginx/default.crt; # self-signed for example only | ||
ssl_certificate_key /etc/ssl/nginx/default.key; | ||
|
||
location / { | ||
status_zone /; | ||
|
||
proxy_set_header Host $host; | ||
proxy_http_version 1.1; | ||
proxy_set_header "Connection" ""; | ||
proxy_pass https://cluster1-https; | ||
|
||
} | ||
|
||
location @health_check_cluster1_cafe { | ||
|
||
health_check interval=10 match=cafe; | ||
proxy_connect_timeout 2s; | ||
proxy_read_timeout 3s; | ||
proxy_set_header Host cafe.example.com; | ||
proxy_pass https://cluster1-https; | ||
} | ||
|
||
} | ||
|
||
match cafe { | ||
status 200-399; | ||
} | ||
|
||
# Cluster1 upstreams | ||
|
||
upstream cluster1-https { | ||
zone cluster1-https 256k; | ||
least_time last_byte; | ||
keepalive 16; | ||
#servers managed by NLK Controller | ||
state /var/lib/nginx/state/cluster1-https.state; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.