Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config option for setting the app's base url #69

Merged
merged 1 commit into from
Feb 7, 2021

Conversation

geoah
Copy link
Contributor

@geoah geoah commented Feb 6, 2021

This PR adds a config option to add a base meta tag in the pyroscope webapp.

The rationalle behind this is to allow the app to be served as a path behind a reverse proxy (ie. https://some.host/pyroscope/)

This can technically be done via the EXTRA_METADATA env var, but requires a path to a file which makes it a bit more cumbersome. (And the render path would need to be made relative still.)


In order to test this out you can do so in a local docker-compose with caddy.

You'll need a docker-compose.yml:

version: "3.8"

services:
  caddy:
    image: caddy
    container_name: caddy
    ports:
      - 8080:8080
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
  
  pyroscope:
    image: pyroscope/pyroscope:dev
    container_name: pyroscope
    ports:
      - 4040:4040
    environment:
      - PYROSCOPE_BASE_URL
    command: server

and a Caddyfile:

{
    http_port 8080
    auto_https off
}

http://localhost {
    redir /pyroscope /pyroscope/
    route /pyroscope* {
        uri strip_prefix pyroscope
        reverse_proxy pyroscope:4040
    }
}

Running docker-compose up and visiting http://localhost:8080/pyroscope/ should work fine (assuming you've first build the container using make build-dev).

@CLAassistant
Copy link

CLAassistant commented Feb 6, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@petethepig petethepig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I tested with the docker-compose provided

Thank you @geoah !

@petethepig petethepig merged commit 86f07d7 into grafana:main Feb 7, 2021
@geoah geoah deleted the add-base-url branch February 9, 2021 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants