Absolute and relative redirects in PMM mixed

Description

PMM uses two kind of redirects - absolute and relative. For instance:

 

pmm.conf

rewrite ^/$ $scheme://$http_host/graph/;     rewrite ^/graph$ /graph/;

 

$ curl https://localhost:443 -v -k --http1.1 2>&1 |grep 'GET\|Location' > GET / HTTP/1.1 < Location: https://localhost/graph/   $ curl https://localhost:443/graph -v -k --http1.1 2>&1 |grep 'GET\|Location' > GET /graph HTTP/1.1 < Location: /graph/login   $ curl -so /dev/null -u admin:admin https://localhost:443/graph/login -v -k --http1.1 2>&1 |grep 'GET\|Location' > GET /graph/login HTTP/1.1 < Location: /graph/

 

After adding absolute_redirects off to Nginx configuration and  changing the / rewrite to:

rewrite ^/$ /graph/ permanent;

 

$ curl   https://localhost:443/ -v -k --http1.1 2>&1 |grep 'GET\|Location' > GET / HTTP/1.1 < Location: /graph/

The main reason for that change is to make PMM to work better with proxies, expescialy some of those can't have the HTTP host request overloaded. Moreover, Grafana uses relative locations already.

 

 

 

How to test

None

How to document

None

AFFECTED CS IDs

CS0028727

Smart Checklist

Activity

Show:

duygu.aksoy November 23, 2022 at 2:35 PM

could you find a chance to groom this? 

Iwo Panowicz August 4, 2022 at 11:47 AM

It should use relative redirects.

Sveta Smirnova August 3, 2022 at 4:38 PM

Which kind of redirects PMM should use if this feature is implemented? Absolute only? Relative only? Both but in different way?

Details

Assignee

Reporter

Priority

Components

Needs QA

Yes

Needs Doc

No

Planned Version/s

Affects versions

Smart Checklist

Created August 3, 2022 at 2:11 PM
Updated March 6, 2024 at 12:52 AM

Flag notifications