Skip to content

Commit

Permalink
Expose actuator metrics through nginx server (#14)
Browse files Browse the repository at this point in the history
On enabling prometheus metrics the `/actuator/prometheus` path is redirected to the UI itself because of the nginx rule. This will expose the actuator routes (health,info,prom) to the user
  • Loading branch information
silent-lad authored Feb 24, 2023
1 parent d6cf03a commit ddb1c05
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docker/config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ server {
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
}

location /actuator {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:8080/actuator;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
}

location /swagger-ui {
proxy_set_header X-Real-IP $remote_addr;
Expand All @@ -41,4 +52,4 @@ server {
proxy_redirect off;
}

}
}

0 comments on commit ddb1c05

Please sign in to comment.