block visitors by country

Discussion in 'ISPConfig 3 Priority Support' started by bobpit, Feb 7, 2014.

  1. bobpit

    bobpit Member

  2. falko

    falko Super Moderator Howtoforge Staff

    Did you add

    Code:
            if ($allowed_country = no) {
                return 444;
            }
    to domain2.com?
     
  3. bobpit

    bobpit Member

    No, I did not. This must be it. I forgot about this setting that is particular to every domain.
     
  4. bobpit

    bobpit Member

    I just checked and the following code was missing from the domain1 vhost file too:
    Code:
            if ($allowed_country = no) {
                return 444;
            }
    This is very strange. Maybe ispconfig changed the vhost file settings and overwrote my changes.
     
  5. bobpit

    bobpit Member

    I just checked. The obove code was AGAIN missing from domain1 and domain2 vhost files.

    I was editing the vhost files and I think ispconfig is overwriting my changes.

    So I decided to enter the above code through ispconfig3, under Sites -> Web Domain -> Options. I did this for both domains. Indeed the code went to the two vhost files. I hope I will not loose the setting again.

    Complete summary of solution: http://bbb-solutions.blogspot.gr/2014/02/block-visitors-by-country.html
     
    Last edited: Feb 16, 2014
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Never edit a vost file manually! You have t add the code that falko posted in the nginx directives field of the website.
     
  7. bobpit

    bobpit Member

    I had suspected that. Somebody should have confirmed this back then:
     

Share This Page