Want to subscribe to topics you're interested in?
Become a Member

Nginx Restricting Access? Best Way

Discussion in 'Install & Upgrades or Pre-Install Questions' started by anthony parsons, Jul 26, 2018.

  1. anthony parsons

    anthony parsons Member

    80
    20
    8
    Feb 12, 2017
    Ratings:
    +25
    Local Time:
    9:24 AM
    1.22.0
    10.4.26
    What is the best way to restrict access to a site with centminmod using cloudflare?

    I tried the allow my ip, deny all, in the vhost conf for the domain, but that blocked everything.

    I see the fqdn uses htpasswd type blocking, so it that the best way?

    I want to restrict domain access to myself during site development, where everyone else just gets an error or such.

     
  2. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    9:24 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    if the site isn't even live yet, just bypass DNS updates and do local hosts file DNS - outlined in last post of migration guide at Upgrade - Nginx - Redis - Insight Guide - Centmin Mod Site Data Migration Guide

    no one but yourself would be able to access the site as only your local computer would have direct domain to ip direction set in your local hosts file (which bypasses DNS and Cloudflare DNS completely)
     
  3. anthony parsons

    anthony parsons Member

    80
    20
    8
    Feb 12, 2017
    Ratings:
    +25
    Local Time:
    9:24 AM
    1.22.0
    10.4.26
    I use Mac. And I have cloudflare certs running... any bypass of that breaks the site.
     
  4. anthony parsons

    anthony parsons Member

    80
    20
    8
    Feb 12, 2017
    Ratings:
    +25
    Local Time:
    9:24 AM
    1.22.0
    10.4.26
  5. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    9:24 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    if the site isn't live yet, there's no harm in temp disabling cloudflare origin authentication pull ssl cert as no one but yourself would know the server ip that the domain points to when using local dns file edits - MacOS has same editing possible just google for the info - i believe it's same as Linux /etc/hosts ? :)

    edit: very first google search entry = How to edit your Mac's Hosts file and why you would want to