N
N
Nikita Kochnev2018-05-02 20:33:59
Nginx
Nikita Kochnev, 2018-05-02 20:33:59

How to formulate a redirect of requests from unauthorized mirrors to the main domain?

Good afternoon, after hacking our server, unwanted mirrors were formed, we managed to solve this problem with such a condom for Apache

RewriteEngine on
RewriteCond %{HTTP_HOST} !^edeal.market$
RewriteRule ^(.*) https://edeal.market/$1 [R=301,L]

However, now the site has been transferred to nginx + php-fpm, so the question arose, how to interpret the same rule for ngnix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Kochnev, 2018-05-02
@1nks1

Thanks everyone, I found this solution.

server {
        listen 80 default_server;
        return 302 https://ВАШ_ДОМЕН$request_uri;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question