title: How to disable security on management port for Spring Boot app?
body: <p>I am setting up a Spring Boot 1.3 secured application, but with an  management port that is inaccessible to the public, so I don't need any security on this port.</p>
  
  <p>This is simply what I want to achieve:</p>
  
  <pre><code>server.port = 8080     # -&gt; secure
  management.port = 8081 # -&gt; unsecure
  </code></pre>
  
  <p>But as soon as I add a WebSecurityConfigurerAdapter, it automatically is in effect for both ports. Setting <code>management.security.enabled=false</code> has no effect if management port is different, is this a bug? How can I otherwise disable security for the management port only?</p>
  
  <p>My simple security configuration:</p>
  
  <pre><code>@Configuration
  @EnableWebSecurity
  static class SecurityConfiguration extends WebSecurityConfigurerAdapter {
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          http.authorizeRequests().anyRequest().authenticated();
      }
  }
  </code></pre>
  
  <p>I know a possible workaround could be to set custom context-path eg. <code>/manage</code> and ignore this path from security, but it doesn't seem ideal to use a non-standard path plus the fiddling to resolve path into the security config without hard-coding it, so I would like to find out whether there is a standard approach to this.</p>