On Sun, Jun 21, 2009 at 7:32 AM, Edho P Arief <edho...@gmail.com> wrote:
On Sun, Jun 21, 2009 at 8:21 PM, Kevin
Castiglione<kevi...@gmail.com> wrote:
On Sat, Jun 20, 2009 at 10:30 PM, Edho P Arief <edho...@gmail.com>
wrote:
On Sun, Jun 21, 2009 at 12:19 PM, Edho P Arief<edho...@gmail.com>
wrote:
here it is
server {
listen 80;
server_name ~(.*)\.([^\.]*)\.([^\.]*)$;
set $domain $2.$3;
rewrite ^.* http://$domain$request_uri permanent;
}
make sure that you have the server_name set on nginx or it'll redirect
to
.
can you tell how i set server_name on nginx for this to work?
create separate server block for each domain name
server {
listen 80;
server_name abcd.com;
...
}
which will be used when nginx detects the domain as abcd.com
without this block, the redirection will go like this:
NNN.abcd.com => abcd.com => . (dot)
with this it'll access correct site instead (stop at abcd.com)
is it possible to do this with just one server block for multiple domains:
for ex:
server {
listen 80;
server_name .abcd.com .efgh.com .ijkl.com
..
}