Get the most out of your Centmin Mod LEMP stack
Become a Member

someone mirrored my website!

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by amin, Apr 28, 2016.

  1. amin

    amin Member

    37
    6
    8
    Oct 11, 2014
    Ratings:
    +7
    Local Time:
    11:42 PM
    Katest
    Latest
    Hi,
    I am not sure if this is proper forum or not, but I am using the latest Centminmod and just found two website which are mirroring my website but replacing my domain name with theirs!

    Is there anyway to avoid my website being loaded under another domain?
     
  2. amin

    amin Member

    37
    6
    8
    Oct 11, 2014
    Ratings:
    +7
    Local Time:
    11:42 PM
    Katest
    Latest
    I just found he set A record to my domain but I dont know how he is eve replacing my domain name in contents!
    Also in apache I think we can stop this in htaccess, but what about Nginx?
     
  3. pamamolf

    pamamolf Well-Known Member

    2,487
    229
    63
    May 31, 2014
    Ratings:
    +390
    Local Time:
    10:12 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    First way on nginx config file use:

    Code:
    if ($http_referer ~* spamdomain1\.com) {
        return 444;
    }
    Or more at once:

    Code:
    if ($http_referer ~ "spamdomain1\.com|spamdomain2\.com|spamdomain3\.com")  {
      return 444;
    }
    Second way use something like this:

    Code:
    map $http_referer $bad_referer {
        default                  0;
        "~spamdomain1.com"       1;
        "~spamdomain2.com"       1;
        "~spamdomain3.com"       1;
    }
    And then on domain config file use:

    Code:
    if ($bad_referer) {
        return 444;
    }
    Third way allow only using:

    Module ngx_http_referer_module

    Code:
    location / {
      valid_referers none blocked *.badreferer1.com badreferer2.com *.badreferer3.com badreferer4.net;
    
      if ($invalid_referer) {
        return   403;
      }
    }
     
    • Like Like x 1
    • Informative Informative x 1
  4. amin

    amin Member

    37
    6
    8
    Oct 11, 2014
    Ratings:
    +7
    Local Time:
    11:42 PM
    Katest
    Latest
    I added it to line 31 of the domain file at /usr/local/nginx/conf/conf.d. It is not working.
     
  5. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,750
    Local Time:
    5:12 AM
    Nginx 1.13.x
    MariaDB 5.5
    Just found this blog article Cloned Website Stealing Google Rankings

     
  6. amin

    amin Member

    37
    6
    8
    Oct 11, 2014
    Ratings:
    +7
    Local Time:
    11:42 PM
    Katest
    Latest
    Thank you guys, after 24 hours this method worked:
    Code:
    if ($http_referer ~ "spamdomain1\.com|spamdomain2\.com|spamdomain3\.com")  {
      return 444;
    }
    But do you have any idea to redirect them to the main domain instead of 444 ?
     
  7. pamamolf

    pamamolf Well-Known Member

    2,487
    229
    63
    May 31, 2014
    Ratings:
    +390
    Local Time:
    10:12 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Maybe something like this?

    Code:
    if ($http_referer ~ "spamdomain1\.com|spamdomain2\.com|spamdomain3\.com")  {
    return 301 $scheme://example.com$request_uri;
    }
    Just replace the example.com :)
     
    • Like Like x 1
  8. amin

    amin Member

    37
    6
    8
    Oct 11, 2014
    Ratings:
    +7
    Local Time:
    11:42 PM
    Katest
    Latest
    Can you tell which files should be edited exactly? The domain file at /usr/local/nginx/conf/conf.d ?
     
  9. pamamolf

    pamamolf Well-Known Member

    2,487
    229
    63
    May 31, 2014
    Ratings:
    +390
    Local Time:
    10:12 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Yes just edit your domain file at /usr/local/nginx/conf/conf.d/ :)
     
    • Like Like x 1