Welcome! Log In Create A New Profile

Advanced

Possible to collapse locations and have variable subdomains?

Posted by mrmanishs 
Possible to collapse locations and have variable subdomains?
June 18, 2009 05:16PM
I currently have:

location /subdomain1/ {
proxy_pass http://localhost:3000/subdomain1/;
proxy_redirect default;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

client_max_body_size 10m;
client_body_buffer_size 128k;

proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;

proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}

location /subdomain2/ {
proxy_pass http://localhost:3000/subdomain2/;
proxy_redirect default;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

client_max_body_size 10m;
client_body_buffer_size 128k;

proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;

proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}

Is it possible to collapse this somehow into a singular location, where the subdomains entered, like "{subdomain1,subdomain2}=subdomain" (pseudocode), is passed into the proxy_pass as "http://localhost:3000/subdomain" (again, pseudocode)?


Thanks
Re: Possible to collapse locations and have variable subdomains?
June 18, 2009 08:57PM
I think not.

--
Jim Ohlstein
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 270
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready