Last active
October 11, 2024 06:47
-
-
Save x1unix/be7e15dbe91b4e63658346c62cefd19a to your computer and use it in GitHub Desktop.
Jaeger + CORS Proxy
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
services: | |
nginx: | |
image: nginx:latest | |
volumes: | |
- ./nginx.conf:/etc/nginx/nginx.conf:ro | |
ports: | |
- "16686:16686" # Both Jaeger UI and exporter are on the same port. | |
depends_on: | |
- jaeger | |
jaeger: | |
image: jaegertracing/all-in-one:1.62.0 | |
environment: | |
COLLECTOR_ZIPKIN_HTTP_PORT: 9411 | |
expose: | |
- "16686" # Jaeger UI | |
- "4318" # HTTP collector |
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
events {} | |
error_log /dev/stderr error; | |
http { | |
server { | |
listen 16686; | |
# Jaeger UI | |
location / { | |
proxy_pass http://jaeger:16686; | |
add_header 'Access-Control-Allow-Origin' '*'; | |
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; | |
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type'; | |
if ($request_method = OPTIONS) { | |
return 204; | |
} | |
} | |
# Jaeger HTTP Collector | |
location /v1/traces { | |
proxy_pass http://jaeger:4318/v1/traces; | |
add_header 'Access-Control-Allow-Origin' '*'; | |
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; | |
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type'; | |
if ($request_method = OPTIONS) { | |
return 204; | |
} | |
} | |
# Jaeger gRPC Collector | |
location /grpc { | |
proxy_pass http://jaeger:14250; | |
add_header 'Access-Control-Allow-Origin' '*'; | |
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; | |
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type'; | |
if ($request_method = OPTIONS) { | |
return 204; | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment