title: Nginx user subdomains, should I proxy_pass?
body: <p>I am trying to setup user subdomains, serving content from specific folders: <code>www.example.com/username</code> served from <code>username.example.com</code> (just like github pages).</p>
  
  <p>I've looked at Nginx rewrites, but I don't want the browser to redirect--I want the domain to be username.example.com.
  Anyway, a comment on <a href="https://stackoverflow.com/questions/2498712/nginx-subdomain-rewrite">this question</a> says that I cannot rewrite host, only proxy to it.
  I tried to setup a <code>proxy_pass</code>, but all of the documentation and examples show it being used to (obviously) proxy to a service on another host or port, but in my case I want to just proxy to another location on the same host and port.</p>
  
  <p>Is this the appropriate way to tackle this problem, and if so, what is the right Nginx config syntax?</p>