title: Enable CORS for "/health" endpoint in Spring Boot Actuator
body: <p>We want to enable <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS" rel="nofollow noreferrer">CORS</a> for all <code>GET</code> requests to the <code>/health</code> endpoint provided by Spring Boot Actuator.</p>
  <p>We tried adding the following bean without success:</p>
  <pre><code>@Bean
  public WebMvcConfigurer corsConfigurer() {
      return new WebMvcConfigurerAdapter() {
          @Override
          public void addCorsMappings(CorsRegistry registry) {
              registry.addMapping(&quot;/health&quot;).allowedMethods(&quot;GET&quot;);
          }
      };
  }
  </code></pre>