You can proxy requests to installed PPEM based on required URL prefixes.
When performing this instruction, consider the following:
nginx is used as a reverse proxy example
/ppem is used as a URL prefix example
To configure PPEM behind a reverse proxy:
On the server where nginx is installed:
In the http block of the nginx.conf
configuration file, specify:
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
Configure redirection to the /ppem URL prefix.
For example, in /etc/nginx/sites-enabled/default,
specify:
server {
listen 80 default_server;
root /var/www/html;
server_name _;
location /ppem/ {
rewrite ^/ppem/(.*)/\$1 break;
proxy_pass http://127.0.0.1:8080/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
}
location / {
return 404;
}
}
Reload nginx:
systemctl reload nginx
For more information, refer to the official nginx documentation.
On the server where the manager is installed:
In the ppem-manager.yml manager configuration
file, specify:
frontend: PPEM_API_PREFIX: /ppem PPEM_FRONTEND_BASENAME: /ppem
In usr/share/ppem/web-app/index.html, replace
<base href="/" /> with <base href="/ppem/" />.
Restart PPEM:
restart ppem
On the servers where agents are installed:
In the ppem-agent.yml agent configuration file,
add the /ppem URL prefix to the agent.manager.url
parameter value.
This value is specified in the
scheme://manager_network_address/path_to_API_version
format. You must add the URL prefix between /manager_network_address/
and /path_to_API_version.
For example, if the current value is https://example.postgrespro.com/v1,
the updated value must be https://example.postgrespro.com/ppem/v1.
Restart the agent:
systemctl restart ppem-agent
(Optional) To enable nginx to download reports
of the required size, in the http, server, or
location directive, specify the client_max_body_size:
parameter.
report_size_in_MBs;
For example, in the server directive, specify:
server {
listen 80 default_server;
root /var/www/html;
server_name _;
client_max_body_size 100M;
....
}
In this case, the maximum report size is 100 MB.