Get the most out of your Centmin Mod LEMP stack
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

    2
    1
    3
    Mar 14, 2017
    Ratings:
    +1
    Local Time:
    7:19 AM
    Hello..
    I am getting a 521 error:
    [​IMG]
    (https://content.screencast.com/user...197-ab75-a72e737b1a16/2017-04-02_22-13-41.png)

    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

    30,924
    6,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,406
    Local Time:
    11:19 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):
    ngxrestart

    or
    Code (Text):
    service nginx restart