rewrite *.*.com Host to *.com

pablo platt pablo.platt at
Thu May 6 22:34:03 MSD 2010


I'm using nginx is a proxy for a long polling application.
Old browsers have low limits on number of concurrent http requests so I'm
using arbitrary subdomains for each vhost.

Is it possible to set the Host header to be when the url
without knowing from advanced what 'something' and 'vhost1' are?

I'm currently able to set Host to *.com but I want to strip the first part.

server {
    listen    80;
    server_name  *.com;

    location /test {
    proxy_set_header  Host $Host;
    proxy_set_header  X-Real-IP  $remote_addr;
    proxy_pass        http://localhost:8000;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list