0

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

tenub
  • 101
  • 1
  • Could you add a table containing input and expected output, e.g. `mydomain.com` => `mydomain/hellworld`? – 030 Sep 05 '14 at 18:52
  • I got around this problem by just installing an additional web directory for my `param1` ("subdomain"). – tenub Sep 05 '14 at 19:20

0 Answers0