Skip to content

Commit

Permalink
Add example of running Jaeger UI behind reverse proxy
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <github@ysh.us>
  • Loading branch information
yurishkuro committed Jan 6, 2024
1 parent 42304f3 commit 11c6974
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/reverse-proxy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# reverse-proxy example

This example illustrates how Jaeger UI can be run behind a reverse proxy under a different URL prefix.

Start the servers:

```sh
cd examples/reverse-proxy
docker compose up
```

Jaeger UI can be accesssed at http://localhost:18080/jaeger/prefix .
28 changes: 28 additions & 0 deletions examples/reverse-proxy/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '3.7'

services:
jaeger:
image: jaegertracing/all-in-one:latest
ports:
- "16686:16686" # Jaeger UI
- "4317:4317" # Collector, OpenTelemetry gRPC
- "4318:4318" # Collector, OpenTelemetry gRPC
environment:
# This tells Jaeger that it should run the UI with a given prefix.
QUERY_BASE_PATH: /jaeger/prefix
networks:
- proxy-net

httpd:
image: httpd:latest
ports:
- "18080:80"
volumes:
- ./httpd.conf:/usr/local/apache2/conf/httpd.conf
depends_on:
- jaeger
networks:
- proxy-net

networks:
proxy-net:
65 changes: 65 additions & 0 deletions examples/reverse-proxy/httpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
ServerRoot "/usr/local/apache2"

Listen 80

LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
# some of the modules below may not be needed
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule filter_module modules/mod_filter.so
LoadModule mime_module modules/mod_mime.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule headers_module modules/mod_headers.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so

# Note that the prefix is used in both the proxy and the backend URLs.
ProxyPass "/jaeger/prefix" "http://jaeger:16686/jaeger/prefix"
ProxyPassReverse "/jaeger/prefix" "http://jaeger:16686/jaeger/prefix"

ErrorLog /proc/self/fd/2
LogLevel info
<IfModule log_config_module>
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common

<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>

#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog /proc/self/fd/1 common

#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog "logs/access_log" combined
</IfModule>

0 comments on commit 11c6974

Please sign in to comment.