Learn about Centmin Mod LEMP Stack today
Register Now

Nginx Is this normal that all sites show blank page when check with responsive online tool test ?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by nVidian, Oct 3, 2018.

Tags:
  1. nVidian

    nVidian Member

    92
    8
    8
    Mar 16, 2015
    Ratings:
    +23
    Local Time:
    1:17 AM
    1.7.9
    5.5
    Please fill in any relevant information that applies to you:
    • CentOS Version: i.e. CentOS 7 64bit ?
    • Centmin Mod Version Installed: i.e. 123.09beta01
    • Nginx Version Installed: i.e. 1.15.0
    • PHP Version Installed: 7.1.18
    • MariaDB MySQL Version Installed: 10.0.36
    • When was last time updated Centmin Mod code base ? : today
    • Persistent Config: Do you have any persistent config file options set in /etc/centminmod/custom_config.inc ? You can check via this command:
      Code (Text):
      cat /etc/centminmod/custom_config.inc
      LETSENCRYPT_DETECT='y'
      PUREFTPD_DISABLED='y'
      
      

    Hello all, is this normal that all my website hosted at my centminmod server only showed blank page when I check responsiveness using these online tools:
    [​IMG] [​IMG]
    These are the screenshots:
    [​IMG] responsive ami
    [​IMG] Responsinatormywebsite

    Also, I use Cloudflare as DNS only (disable caching) and not using any CDN.

    This is my nginx.conf file
    Code:
    user              nginx nginx;
    worker_processes 2;
    worker_priority -10;
    
    worker_rlimit_nofile 260000;
    timer_resolution 100ms;
    
    pcre_jit on;
    
    pid         logs/nginx.pid;
    
    events {
        worker_connections  15000;
        accept_mutex on;
        accept_mutex_delay 200ms;
        use epoll;
        #multi_accept on;
    }
    
    http {
    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/vts_http.conf;
    include /usr/local/nginx/conf/geoip.conf;
    include /usr/local/nginx/conf/maintenance.conf;
    
    #include /usr/local/nginx/conf/pagespeedadmin.conf;
    include /usr/local/nginx/conf/fastcgi_param_https_map.conf;
    
    log_format      main    '$remote_addr - $remote_user [$time_local] $request '
                    '"$status" $body_bytes_sent "$http_referer" '
                    '"$http_user_agent" "$http_x_forwarded_for" "$gzip_ratio"'
                    ' "$connection" "$connection_requests" "$request_time"';
    
    access_log  off;
    error_log   logs/error.log warn;
    
        index  index.php index.html index.htm;
        include       mime.types;
        default_type  application/octet-stream;
        charset utf-8;
    
            sendfile on;
            sendfile_max_chunk 512k;
            tcp_nopush  on;
            tcp_nodelay on;
            server_tokens off;
            server_name_in_redirect off;
         
            keepalive_timeout  5;
            keepalive_requests 1000;
            lingering_time 20s;
            lingering_timeout 5s;
            keepalive_disable msie6;
    
        gzip on;
        gzip_vary   on;
        gzip_disable "MSIE [1-6]\.";
            gzip_static on;
            gzip_min_length   1400;
            gzip_buffers      1024 8k;
            gzip_http_version 1.0;
            gzip_comp_level 5;
            gzip_proxied    any;
            gzip_types text/plain text/css text/xml application/javascript application/x-javascript application/xml application/xml+rss application/ecmascript application/json image/svg+xml;
    
     client_body_buffer_size 256k;
     client_body_in_file_only off;
     client_body_timeout 60s;
     client_header_buffer_size 64k;
    ## how long a connection has to complete sending
    ## it's headers for request to be processed
     client_header_timeout  8s;
     client_max_body_size 1024m;
     connection_pool_size  512;
     directio  4m;
     directio_alignment 512;
     ignore_invalid_headers on;    
     large_client_header_buffers 8 64k;
     output_buffers   1 512k;
     postpone_output  1460;
     proxy_temp_path  /tmp/nginx_proxy/;
     request_pool_size  32k;
     reset_timedout_connection on;
     send_timeout     60s;
     types_hash_max_size 2048;
     server_names_hash_bucket_size 64;
    
    # for nginx proxy backends to prevent redirects to backend port
    # port_in_redirect off;
    
    open_file_cache max=50000 inactive=60s;
    open_file_cache_valid 120s;
    open_file_cache_min_uses 2;
    open_file_cache_errors off;
    open_log_file_cache max=10000 inactive=30s min_uses=2;
    
    ## limit number of concurrency connections per ip to 16
    ## add to your server {} section the next line
    ## limit_conn limit_per_ip 16;
    ## uncomment below line allows 500K sessions
    # limit_conn_log_level error;
    #######################################
    # use limit_zone for Nginx <v1.1.7 and lower
    # limit_zone $binary_remote_addr zone=limit_per_ip:16m;
    #######################################
    # use limit_conn_zone for Nginx >v1.1.8 and higher
    # limit_conn_zone $binary_remote_addr zone=limit_per_ip:16m;
    #######################################
    
     include /usr/local/nginx/conf/conf.d/*.conf;
    }
    

    This is sample of mywebsite.site.ssl.conf
    Code:
    #x# HTTPS-DEFAULT
     server {
     
       server_name mywebsite.site www.mywebsite.site;
       return 302 https://mywebsite.site$request_uri;
       include /usr/local/nginx/conf/staticfiles.conf;
     }
    
    #       listen   80;
    #       server_name mywebsite.site www.mywebsite.site;
    #       return 302 https://$server_name$request_uri;
    
    server {
      listen 443 ssl http2;
      server_name mywebsite.site www.mywebsite.site;
    
      include /usr/local/nginx/conf/ssl/mywebsite.site/mywebsite.site.crt.key.conf;
      include /usr/local/nginx/conf/ssl_include.conf;
    
      # cloudflare authenticated origin pull cert community.centminmod.com/threads/13847/
      #ssl_client_certificate /usr/local/nginx/conf/ssl/cloudflare/mywebsite.site/origin.crt;
      #ssl_verify_client on;
      http2_max_field_size 16k;
      http2_max_header_size 32k;
      # mozilla recommended
      ssl_ciphers ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS;
      ssl_prefer_server_ciphers   on;
      #add_header Alternate-Protocol  443:npn-spdy/3;
    
      # before enabling HSTS line below read centminmod.com/nginx_domain_dns_setup.html#hsts
      #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
      #add_header X-Frame-Options SAMEORIGIN;
      add_header X-Xss-Protection "1; mode=block" always;
      add_header X-Content-Type-Options "nosniff" always;
      #add_header Referrer-Policy "strict-origin-when-cross-origin";
      #spdy_headers_comp 5;
      ssl_buffer_size 1369;
      ssl_session_tickets on;
     
      # enable ocsp stapling
      resolver 8.8.8.8 8.8.4.4 valid=10m;
      resolver_timeout 10s;
      ssl_stapling on;
      ssl_stapling_verify on;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/mywebsite.site/log/access.log combined buffer=256k flush=5m;
      error_log /home/nginx/domains/mywebsite.site/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/mywebsite.site/autoprotect-mywebsite.site.conf;
      root /home/nginx/domains/mywebsite.site/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      include /root/mycustomconf/d7.conf;
      include /usr/local/nginx/conf/pre-staticfiles-local-mywebsite.site.conf;
      include /usr/local/nginx/conf/pre-staticfiles-global.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
     
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    
    And this is my /root/mycustomconf/d7.conf (Drupal 7 conf) included
    Code:
            http2_push_preload on;
       
            location / {
                #try_files  @rewrite; # For Drupal <= 6
                try_files $uri /index.php?$query_string; # For Drupal >= 7
            }
       
            location @rewrite {
                    # Some modules enforce no slash (/) at the end of the URL
                    # Else this rewrite block wouldn't be needed (GlobalRedirect)
                    rewrite ^/(.*)$ /index.php?q=$1;
                    # Drupal in a subdirectory
                    rewrite ^/([^/]*)/(.*)(/?)$ /$1/index.php?q=$2&$args;
            }
       
            #location = /favicon.ico {
                    #log_not_found off;
                    #access_log off;
            #}
     
            #location = /robots.txt {
                    #allow all;
                    #log_not_found off;
                    #access_log off;
            #}
     
            # This matters if you use drush
            location = /backup {
                    deny all;
            }
     
            # Very rarely should these ever be accessed outside of your lan
            location ~* \.(txt|log)$ {
                    allow 192.168.0.0/16;
                    deny all;
            }
     
            location ~ \..*/.*\.php$ {
                    return 403;
            }
     
            location ~ \.php$ {
                    error_page 418 = @rewrite;
                    recursive_error_pages on;
     
                    fastcgi_split_path_info ^[^=](.+\.php)(/.+)$;
                    include fastcgi_params;
     
                    if ( $uri = /index.php ) {
                            # not sure this conditional works, will have to check the debug logs
                            break;
                    }
     
                    if ( !-e $document_root$fastcgi_script_name) {
                            return 418;
                    }
     
                    #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                    #fastcgi_intercept_errors on;
                    #fastcgi_read_timeout 240;
                    fastcgi_pass  127.0.0.1:9000;
            }
     
            # Fighting with ImageCache? This little gem is amazing.
            location ~ ^/sites/.*/files/imagecache/ {
                    try_files $uri @rewrite;
            }
            # Catch image styles for D7 too.
            location ~ ^/sites/.*/files/styles/ {
                    try_files $uri @rewrite;
            }
     
            location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                    #expires max;
            expires 30d;
                    log_not_found off;
            }
    
     
    Last edited: Oct 3, 2018
  2. eva2000

    eva2000 Administrator Staff Member

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    4:17 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    do other centmin mod hosted nginx sites have same issue or just this specific site with those testing tools ? could be the tools that have issues and not the site ?

    have you used chrome dev tools native device emulator to see if it's the same ?
     
  3. nVidian

    nVidian Member

    92
    8
    8
    Mar 16, 2015
    Ratings:
    +23
    Local Time:
    1:17 AM
    1.7.9
    5.5
    The sites have no issue with Chrome dev native tools.

    All centminmod hosted sites have same issue - but they're all drupal sites. So I create a simple html site only contain <h1> tag and it works with those online tools even with custom drupal nginx config included.

    To make it more confusing, I have Plesk server with standalone nginx but all drupal sites hosted there have no problems with those online tools.
     
..