How can I make http://param1.domain.com
act as if it's loading http://domain.com/param1
in Nginx? I do not want to redirect to http://domain.com/param1
. So far I have created a new server block containing the following:
...
server_name param1.domain.com;
...
location / {
return 301 "http://domain.com/param1${uri}";
}
...
but as mentioned above this just redirects the url.
Also, I am using a PHP framework to route using the param1
and other $uri
parameters. Is this even possible without a redirect? Ie. I'd like to use something like http://param1.domain.com/param2
instead of http://domain.com/param1/param2