I'm trying to setup a proxy with Nginx for Percona Monitoring and Management (PMM). I'm using their public demo site for a testing purpose.
The goal is to expose PMM interface via URL like https://localhost.local/pmm
.
server {
listen 443 default_server ssl http2;
server_name localhost;
ssl_certificate /etc/pki/tls/certs/localhost.crt;
ssl_certificate_key /etc/pki/tls/private/localhost.key;
location ^~ /pmm/ {
proxy_pass https://pmmdemo.percona.com/;
rewrite ^/pmm/(.*) /$1 break;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Authorization "";
}
}
There are a few different URLs on the backend software.
This is currently NOT working properly and I can see a 404
requests in the browser console for URLs like https://localhost/graph/public/build/grafana.dark.css?v5.0.4
I tried to add a rewrite rule: rewrite ^/pmm/(.*) /$1 break;
but this still didn't help.