-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nginx config for load balancing gRPC requests
- Loading branch information
Showing
4 changed files
with
89 additions
and
15 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
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,48 @@ | ||
worker_processes 1; | ||
|
||
error_log /usr/local/var/log/nginx/error.log; | ||
|
||
events { | ||
worker_connections 10; | ||
} | ||
|
||
http { | ||
access_log /usr/local/var/log/nginx/access.log; | ||
|
||
upstream auth_services { | ||
server 0.0.0.0:50051; | ||
server 0.0.0.0:50052; | ||
} | ||
|
||
upstream laptop_services { | ||
server 0.0.0.0:50051; | ||
server 0.0.0.0:50052; | ||
} | ||
|
||
server { | ||
listen 8080 ssl http2; | ||
|
||
# Mutual TLS between gRPC client and nginx | ||
ssl_certificate cert/server-cert.pem; | ||
ssl_certificate_key cert/server-key.pem; | ||
|
||
ssl_client_certificate cert/ca-cert.pem; | ||
ssl_verify_client on; | ||
|
||
location /techschool.pcbook.AuthService { | ||
grpc_pass grpcs://auth_services; | ||
|
||
# Mutual TLS between nginx and gRPC server | ||
grpc_ssl_certificate cert/server-cert.pem; | ||
grpc_ssl_certificate_key cert/server-key.pem; | ||
} | ||
|
||
location /techschool.pcbook.LaptopService { | ||
grpc_pass grpcs://laptop_services; | ||
|
||
# Mutual TLS between nginx and gRPC server | ||
grpc_ssl_certificate cert/server-cert.pem; | ||
grpc_ssl_certificate_key cert/server-key.pem; | ||
} | ||
} | ||
} |