title: How to change basePath for Springfox Swagger 2.0
body: <p>I'm running a service, where Swagger UI is accessible at:</p>
  
  <pre><code>http://serviceURL/swagger-ui.html
  </code></pre>
  
  <p>However, it is behind a proxy, such as:</p>
  
  <pre><code>http://proxyURL/serviceName
  </code></pre>
  
  <p>Generated URLs by Swagger UI are looking like:</p>
  
  <pre><code>http://proxyURL/
  </code></pre>
  
  <p>instead of the actual URL with the serviceName as suffix.
  As far as I get it, this means manipulating the basePath property. As per documentation:</p>
  
  <blockquote>
    <p>A swagger API documentation can no longer describe operations on
    different base paths. In 1.2 and earlier, each resource could have had
    a separate basePath. In 2.0, the basePath equivalents
    (schemes+host+basePath) are defined for the whole specification.</p>
  </blockquote>
  
  <p>@Api(basePath) is deprecated, and it doesn't say what to use and how to use it. How to make the paths generated by Swagger appear properly?</p>
  
  <p>I'm using <strong>Spring Boo</strong>t, Springfox <strong>Swagger</strong> and annotations.</p>