0
0
Nginxdevops~10 mins

gRPC proxying in Nginx - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable gRPC proxying in NGINX.

Nginx
location /grpc-service/ {
    grpc_pass [1];
}
Drag options to blanks, or click blank then click option'
Agrpc://localhost:50051
Bgrpc+unix://localhost:50051
Chttps://localhost:50051
Dhttp://localhost:50051
Attempts:
3 left
💡 Hint
Common Mistakes
Using http:// instead of grpc:// causes proxying to fail.
Using https:// without proper TLS setup causes errors.
2fill in blank
medium

Complete the code to set the HTTP version required for gRPC proxying.

Nginx
location /grpc-service/ {
    grpc_pass grpc://localhost:50051;
    proxy_http_version [1];
}
Drag options to blanks, or click blank then click option'
A1.1
B2.0
C1.0
D3.0
Attempts:
3 left
💡 Hint
Common Mistakes
Setting proxy_http_version to 2.0 causes configuration errors.
Using 1.0 disables required features for gRPC.
3fill in blank
hard

Fix the error in the code to correctly set the gRPC timeout.

Nginx
location /grpc-service/ {
    grpc_pass grpc://localhost:50051;
    proxy_connect_timeout [1];
}
Drag options to blanks, or click blank then click option'
A300
B30sec
C30
D30s
Attempts:
3 left
💡 Hint
Common Mistakes
Using numbers without units causes configuration errors.
Using incorrect units like 'sec' instead of 's' causes errors.
4fill in blank
hard

Fill both blanks to add headers needed for gRPC proxying.

Nginx
location /grpc-service/ {
    grpc_pass grpc://localhost:50051;
    proxy_set_header [1] $http_host;
    proxy_set_header [2] $http_upgrade;
}
Drag options to blanks, or click blank then click option'
AHost
BConnection
CUpgrade
DContent-Type
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong header names causes proxying issues.
Missing these headers breaks gRPC communication.
5fill in blank
hard

Fill all three blanks to configure NGINX for secure gRPC proxying with TLS.

Nginx
location /grpc-secure/ {
    grpc_pass [1];
    proxy_ssl_certificate [2];
    proxy_ssl_certificate_key [3];
}
Drag options to blanks, or click blank then click option'
Agrpcs://localhost:50052
B/etc/nginx/ssl/client.crt
C/etc/nginx/ssl/client.key
Dgrpc://localhost:50052
Attempts:
3 left
💡 Hint
Common Mistakes
Using grpc:// instead of grpcs:// disables TLS.
Incorrect certificate paths cause connection failures.