diff --git a/examples/reverse-proxy/README.md b/examples/reverse-proxy/README.md new file mode 100644 index 00000000000..bcf8d3772fe --- /dev/null +++ b/examples/reverse-proxy/README.md @@ -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 . diff --git a/examples/reverse-proxy/docker-compose.yml b/examples/reverse-proxy/docker-compose.yml new file mode 100644 index 00000000000..0e368ffbd4f --- /dev/null +++ b/examples/reverse-proxy/docker-compose.yml @@ -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: diff --git a/examples/reverse-proxy/httpd.conf b/examples/reverse-proxy/httpd.conf new file mode 100644 index 00000000000..ee0dfc9224b --- /dev/null +++ b/examples/reverse-proxy/httpd.conf @@ -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 + + # + # 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 + + + # 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 + + + # + # The location and format of the access logfile (Common Logfile Format). + # If you do not define any access logfiles within a + # container, they will be logged here. Contrariwise, if you *do* + # define per- 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 +