Welcome to Centmin Mod Community
Register Now

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 Premium Member Premium Member

    77
    18
    8
    Feb 12, 2017
    Ratings:
    +22
    Local Time:
    6:02 PM
    Current yum stable
    10.1
    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

    36,386
    7,991
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,302
    Local Time:
    5:02 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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 Premium Member Premium Member

    77
    18
    8
    Feb 12, 2017
    Ratings:
    +22
    Local Time:
    6:02 PM
    Current yum stable
    10.1
    I use Mac. And I have cloudflare certs running... any bypass of that breaks the site.
     
  4. anthony parsons

    anthony parsons Premium Member Premium Member

    77
    18
    8
    Feb 12, 2017
    Ratings:
    +22
    Local Time:
    6:02 PM
    Current yum stable
    10.1
  5. eva2000

    eva2000 Administrator Staff Member

    36,386
    7,991
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,302
    Local Time:
    5:02 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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
     
..