Learn about Centmin Mod LEMP Stack today
Become a Member

Cloudflare Domains SSL Cloudflare 521 + Centminmod

Discussion in 'Domains, DNS, Email & SSL Certificates' started by Rodrigo Vazquez, Apr 3, 2017.

  1. Rodrigo Vazquez

    Rodrigo Vazquez New Member

    Mar 14, 2017
    Local Time:
    10:02 PM
    I am getting a 521 error:

    Not sure why, I installed centminmod, create a vhost with wordpress instance, then I went to my Cloudflare DNS Management and added a A Record using server IP and the subdomain I just created with the CLI help from centminmod.

    Am I missing something?
  2. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    1:02 PM
    Nginx 1.13.x
    MariaDB 5.5
    If you use a reverse proxy in front of Centmin Mod Nginx, you need to setup nginx realip to be passed onto Nginx.

    See Getting Started Guide step 4 and setting correct real ip via nginx module config at http://centminmod.com/nginx_configure_cloudflare.html.

    If using Centmin Mod 123.09beta01 and newer, there's an added tools/csfcf.sh script to aid in this. Details at:
    You just need to setup a cronjob to run
    Code (Text):
    /usr/local/src/centminmod/tools/csfcf.sh auto

    and ensure your nginx.conf http{} context has the include file /usr/local/nginx/conf/cloudflare.conf and/or your individual nginx vhost's server contexts has the same include file
    Code (Text):
    http {
    map_hash_bucket_size 128;
    map_hash_max_size 2048;
    server_names_hash_bucket_size 128;
    server_names_hash_max_size 2048;
    limit_req_zone $binary_remote_addr zone=xwplogin:16m rate=40r/m;
    #limit_conn_zone $binary_remote_addr zone=xwpconlimit:16m;
    more_set_headers "Server: nginx centminmod";
    more_set_headers "X-Powered-By: centminmod";
    include /usr/local/nginx/conf/cloudflare.conf;
    include /usr/local/nginx/conf/maintenance.conf;
    include /usr/local/nginx/conf/vts_http.conf;
    include /usr/local/nginx/conf/geoip.conf;
    #include /usr/local/nginx/conf/pagespeedadmin.conf;
    include /usr/local/nginx/conf/fastcgi_param_https_map.conf;

    Then restart nginx server via command shortcut
    Code (Text):

    Code (Text):
    service nginx restart