Dynamically set current domain in nginx with perl module
- by Simone Margaritelli
i know how to set variables and use subroutines with the nginx builtin perl module INSIDE a "server" directive but, what i need to do is to set/rewrite the current domain before ...
let's say, we have a domain like
admin.foobar.website.com
i want that a request to
foobar.othersite.com
points to the first address ( obviously website.com and othersite.com are hosted on the same webserver running nginx :) ).
For reasons i can't explain here, i can not use multiple server_name directive expressions, i have to do this before the server {} block, with perl or anyway possible.
Thanks