Nginx user subdomains, should I proxy_pass?
- by Kevin L.
I am trying to setup user subdomains, serving content from specific folders: www.example.com/username served from username.example.com (just like github pages).
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 this question says that I cannot rewrite host, only proxy to it.
I tried to setup a proxy_pass, 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.
Is this the appropriate way to tackle this problem, and if so, what is the right Nginx config syntax?