title: How to configurate nginx and uwsgi to redirect calls from path to subdomain?
body: <p>i am running a flask app on uwsgi and nginx. They website serves two functions:</p>
  
  <ul>
  <li><code>/admin</code>:for backend administration</li>
  <li><code>/api</code>:for rest api</li>
  </ul>
  
  <p>I want all api calls go through the subdomain:api.mysite.com.</p>
  
  <p>It is runing very well if i call api like <code>www.mysite.com/api/v1/cities</code>.</p>
  
  <p>what if i want to call the api this way, <code>api.mysite.com/v1/cities</code>?</p>
  
  <p>How could i manage to do this?</p>