Nginx HTTP redirect с requested домена на другой адрес

редирект без использования location:

server {
listen IP:80;
server_name requested_domain.tld;
rewrite ^ http://target_domain.tld$request_uri;
}

редирект с использованием location:

server {
listen IP:80;
server_name requested_domain.tld;
location = / { rewrite ^ http://redirect.to/; }
}

Leave a Reply

Ваш адрес email не будет опубликован. Обязательные поля помечены *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>