1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/prometheus_ynh.git synced 2024-09-03 20:16:01 +02:00

Fix installation on subpath

This commit is contained in:
tituspijean 2022-02-06 23:28:31 +01:00
parent e846ca680e
commit 0f83354c47
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720
3 changed files with 4 additions and 2 deletions

View file

@ -6,7 +6,7 @@ location __PATH__ {
rewrite ^ https://$server_name$request_uri? permanent; rewrite ^ https://$server_name$request_uri? permanent;
} }
proxy_pass http://127.0.0.1:__PORT____PATH__; proxy_pass http://127.0.0.1:__PORT__;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

View file

@ -9,7 +9,8 @@ Group=__APP__
WorkingDirectory=__FINALPATH__/ WorkingDirectory=__FINALPATH__/
ExecStart=__FINALPATH__/prometheus \ ExecStart=__FINALPATH__/prometheus \
--config.file=__FINALPATH__/prometheus.yml --web.enable-admin-api \ --config.file=__FINALPATH__/prometheus.yml --web.enable-admin-api \
--web.external-url=__PATH__ \ --web.external-url=__PATH__/ \
--web.route-prefix=__PATH__/ \
--web.listen-address=localhost:__PORT__ --web.listen-address=localhost:__PORT__
StandardOutput=append:/var/log/__APP__/__APP__.log StandardOutput=append:/var/log/__APP__/__APP__.log
StandardError=inherit StandardError=inherit

View file

@ -113,6 +113,7 @@ ynh_add_systemd_config
ynh_script_progression --message="Configuring the app..." --weight=2 ynh_script_progression --message="Configuring the app..." --weight=2
ynh_replace_string --match_string="localhost:9090" --replace_string="localhost:$port" --target_file="$final_path/prometheus.yml" ynh_replace_string --match_string="localhost:9090" --replace_string="localhost:$port" --target_file="$final_path/prometheus.yml"
echo " metrics_path: $path_url/metrics" >> "$final_path/prometheus.yml"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION