Join the community today
Become a Member

Nginx Failed Custom Conf Rules

Discussion in 'Bug Reports' started by ivanc82, Oct 5, 2016.

  1. ivanc82

    ivanc82 New Member

    23
    2
    3
    Dec 1, 2015
    Ratings:
    +4
    Local Time:
    9:27 PM
    1.11.4
    MariaDB 10
    Hi, i'm having an issue with nginx failed today when restart nginx. I have my own rewrite rules in my domainname.conf. It was working fine for years but it failed today

    i have this line at the bottom

    include /home/nginx/domains/domainname.com/conf/rewrite.conf

    when i try to nprestart the error is prompted

    Restarting nginx (via systemctl): Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

    anyone help?
     
  2. eva2000

    eva2000 Administrator Staff Member

    29,008
    6,580
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,770
    Local Time:
    11:27 PM
    Nginx 1.13.x
    MariaDB 5.5
  3. ivanc82

    ivanc82 New Member

    23
    2
    3
    Dec 1, 2015
    Ratings:
    +4
    Local Time:
    9:27 PM
    1.11.4
    MariaDB 10
    Here's the output

    Code:
    [root@li854-32 uploads]# nginx -t
    nginx: [emerg] invalid number of arguments in "include" directive in /usr/local/nginx/conf/conf.d/edmdroid.com.conf:84
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
    Code:
    user              nginx nginx;
    worker_processes 2;
    worker_priority -10;
    
    worker_rlimit_nofile 260000;
    timer_resolution 100ms;
    
    pcre_jit on;
    include /usr/local/nginx/conf/dynamic-modules.conf;
    
    
    pid         logs/nginx.pid;
    
    events {
        worker_connections  10000;
        accept_mutex off;
        accept_mutex_delay 200ms;
        use epoll;
        #multi_accept on;
    }
    
    http { 
    limit_req_zone $binary_remote_addr zone=xwprpc:10m rate=30r/s;
    
     map_hash_bucket_size 128;
     map_hash_max_size 4096;
     server_names_hash_bucket_size 128;
     server_names_hash_max_size 2048;
     variables_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";
    
    # 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/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;
    include /usr/local/nginx/conf/redisupstream.conf;
    include /usr/local/nginx/conf/wpcacheenabler_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"';
    
    log_format  ddos-proxy '$remote_addr for $http_x_real_ip - $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"';
    
    log_format  main_ext '$remote_addr - $remote_user [$time_local] "$request" '
                             '$status $body_bytes_sent "$http_referer" '
                             '"$http_user_agent" "$http_x_forwarded_for" '
                             'rt=$request_time ua="$upstream_addr" '
                             'us="$upstream_status" ut="$upstream_response_time" '
                             'ul="$upstream_response_length" '
                             'cs=$upstream_cache_status' ;
    
    access_log  logs/access.log combined buffer=128k flush=5m;
    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 500;
            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      32 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 10s;
     client_header_buffer_size 64k;
    ## how long a connection has to complete sending 
    ## it's headers for request to be processed
     client_header_timeout  5s;
     client_max_body_size 50m; 
     connection_pool_size  512;
     directio  4m;
     ignore_invalid_headers on;      
     large_client_header_buffers 8 64k;
     output_buffers   8 256k;
     postpone_output  1460;
     proxy_temp_path  /tmp/nginx_proxy/;
     request_pool_size  32k;
     reset_timedout_connection on;
     send_timeout     10s;
     types_hash_max_size 2048;
    
    # 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;
    }
    
    
     
    Last edited: Oct 5, 2016
  4. eva2000

    eva2000 Administrator Staff Member

    29,008
    6,580
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,770
    Local Time:
    11:27 PM
    Nginx 1.13.x
    MariaDB 5.5
    what's contents of /usr/local/nginx/conf/conf.d/edmdroid.com.conf ? you can post to a pastebin.com entry if you want too
     
  5. ivanc82

    ivanc82 New Member

    23
    2
    3
    Dec 1, 2015
    Ratings:
    +4
    Local Time:
    9:27 PM
    1.11.4
    MariaDB 10
    hi eva,

    Code:
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name edmdroid.com;
    #            return 301 $scheme://www.edmdroid.com$request_uri;
    #       }
    
    server {
     
      server_name edmdroid.com www.edmdroid.com;
    
    # 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;
    
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/edmdroid.com/log/access.log main_ext buffer=256k flush=60m;
      error_log /home/nginx/domains/edmdroid.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/edmdroid.com/autoprotect-edmdroid.com.conf;
      root /home/nginx/domains/edmdroid.com/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 /usr/local/nginx/conf/wpincludes/edmdroid.com/wpcacheenabler_edmdroid.com.conf;
      include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsupercache_edmdroid.com.conf;
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/rediscache_edmdroid.com.conf; 
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
     
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # for wordpress super cache plugin
      try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    
      # for wp cache enabler plugin
      #try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;   
    
      # Wordpress Permalinks
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      # Nginx level redis Wordpress
      # https://community.centminmod.com/posts/18828/
      #try_files $uri $uri/ /index.php?$args;
    
      }
    
    location ~* /(wp-login\.php) {
        limit_req zone=xwplogin burst=1 nodelay;
        #limit_conn xwpconlimit 30;
        #auth_basic "Private";
        #auth_basic_user_file /home/nginx/domains/edmdroid.com/htpasswd_wplogin; 
        include /usr/local/nginx/conf/php-wpsc.conf;
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /(xmlrpc\.php) {
        limit_req zone=xwprpc burst=45 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
      #include /home/nginx/domains/edmdroid.com/conf/rewrite.conf
      include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf;
      include /usr/local/nginx/conf/php-wpsc.conf;
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/php-rediscache.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    
     
  6. eva2000

    eva2000 Administrator Staff Member

    29,008
    6,580
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,770
    Local Time:
    11:27 PM
    Nginx 1.13.x
    MariaDB 5.5
    line 84 should be related to
    Code (Text):
    /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf

    what's contents of that file in CODE tags
     
  7. eva2000

    eva2000 Administrator Staff Member

    29,008
    6,580
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,770
    Local Time:
    11:27 PM
    Nginx 1.13.x
    MariaDB 5.5
    oh actually i see you list your rewrite.conf with closing semi-colon ;
    Code (Text):
    #include /home/nginx/domains/edmdroid.com/conf/rewrite.conf

    should add ; to end of that include if you intend to uncomment the include file at /home/nginx/domains/edmdroid.com/conf/rewrite.conf
     
  8. ivanc82

    ivanc82 New Member

    23
    2
    3
    Dec 1, 2015
    Ratings:
    +4
    Local Time:
    9:27 PM
    1.11.4
    MariaDB 10
    it's quite long.. here it is

    Code:
    # prevent .zip, .gz, .tar, .bzip2 files from being accessed by default
    # impossible for centmin mod to know which wp backup plugins they installed
    # which may save backups to directories in wp-content/
    # such plugins may deploy .htaccess protection but that isn't supported in
    # nginx, so blocking access to these extensions is a workaround to cover all bases
    
    # prepare for letsencrypt 
    # https://community.centminmod.com/posts/17774/
    location ~ /.well-known {
      location ~ /.well-known/acme-challenge/(.*) {
        more_set_headers    "Content-Type: text/plain";
        }
    }
    
    location ~* ^/(wp-content)/(.*?)\.(zip|gz|tar|bzip2|7z)$ { deny all; }
    
    location ~ ^/wp-content/uploads/sucuri { deny all; }
    
    location ~ ^/wp-content/updraft { deny all; }
    
    # Block nginx-help log from public viewing
    location ~* /wp-content/uploads/nginx-helper/ { deny all; }
    
    location ~ ^/(wp-includes/js/tinymce/wp-tinymce.php) {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Deny access to any files with a .php extension in the uploads directory
    # Works in sub-directory installs and also in multisite network
    location ~* /(?:uploads|files)/.*\.php$ {
    deny all;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/sparkpost/
    location ~ ^/wp-content/plugins/sparkpost/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/sendgrid-email-delivery-simplified/
    location ~ ^/wp-content/plugins/sendgrid-email-delivery-simplified/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/mailgun/
    location ~ ^/wp-content/plugins/mailgun/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/mailjet-for-wordpress/
    location ~ ^/wp-content/plugins/mailjet-for-wordpress/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/easy-wp-smtp/
    location ~ ^/wp-content/plugins/easy-wp-smtp/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/postman-smtp/
    location ~ ^/wp-content/plugins/postman-smtp/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/sendpress/
    location ~ ^/wp-content/plugins/sendpress/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/wp-mail-bank/
    location ~ ^/wp-content/plugins/wp-mail-bank/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/theme-check/
    location ~ ^/wp-content/plugins/theme-check/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/woocommerce/
    location ~ ^/wp-content/plugins/woocommerce/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/woocommerce-csvimport/
    location ~ ^/wp-content/plugins/woocommerce-csvimport/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/advanced-custom-fields/
    location ~ ^/wp-content/plugins/advanced-custom-fields/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/contact-form-7/
    location ~ ^/wp-content/plugins/contact-form-7/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/duplicator/
    location ~ ^/wp-content/plugins/duplicator/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/jetpack/
    location ~ ^/wp-content/plugins/jetpack/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/nextgen-gallery/
    location ~ ^/wp-content/plugins/nextgen-gallery/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/tinymce-advanced/
    location ~ ^/wp-content/plugins/tinymce-advanced/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/updraftplus/
    location ~ ^/wp-content/plugins/updraftplus/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/wordpress-importer/
    location ~ ^/wp-content/plugins/wordpress-importer/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/wordpress-seo/
    location ~ ^/wp-content/plugins/wordpress-seo/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/wpclef/
    location ~ ^/wp-content/plugins/wpclef/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/mailchimp-for-wp/
    location ~ ^/wp-content/plugins/mailchimp-for-wp/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/wp-optimize/
    location ~ ^/wp-content/plugins/wp-optimize/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/si-contact-form/
    location ~ ^/wp-content/plugins/si-contact-form/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/akismet/
    location ~ ^/wp-content/plugins/akismet/ {
      location ~ ^/wp-content/plugins/akismet/(.+/)?(form|akismet)\.(css|js)$ { allow all; }
      location ~ ^/wp-content/plugins/akismet/(.+/)?(.+)\.(png|gif)$ { allow all; }
      location ~* /wp-content/plugins/akismet/akismet/.*\.php$ {
        include /usr/local/nginx/conf/php.conf;
        # below include file needs to be manually created at that path and to be uncommented
        # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
        # allows you to add commonly shared settings to all wp plugin location matches which
        # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
        #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
        allow 127.0.0.1;
        deny all;
      }
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/bbpress/
    location ~ ^/wp-content/plugins/bbpress/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/buddypress/
    location ~ ^/wp-content/plugins/buddypress/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/all-in-one-seo-pack/
    location ~ ^/wp-content/plugins/all-in-one-seo-pack/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/google-analytics-for-wordpress/
    location ~ ^/wp-content/plugins/google-analytics-for-wordpress/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/regenerate-thumbnails/
    location ~ ^/wp-content/plugins/regenerate-thumbnails/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/wp-pagenavi/
    location ~ ^/wp-content/plugins/wp-pagenavi/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/wordfence/
    location ~ ^/wp-content/plugins/wordfence/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/really-simple-captcha/
    location ~ ^/wp-content/plugins/really-simple-captcha/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/wp-pagenavi/
    location ~ ^/wp-content/plugins/wp-pagenavi/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/ml-slider/
    location ~ ^/wp-content/plugins/ml-slider/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/black-studio-tinymce-widget/
    location ~ ^/wp-content/plugins/black-studio-tinymce-widget/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/disable-comments/
    location ~ ^/wp-content/plugins/disable-comments/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for https://wordpress.org/plugins/better-wp-security/
    location ~ ^/wp-content/plugins/better-wp-security/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for http://wlmsocial.com/
    location ~ ^/wp-content/plugins/wlm-social/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Whitelist Exception for mediagrid timthumb
    location ~ ^/wp-content/plugins/media-grid/classes/ {
      include /usr/local/nginx/conf/php.conf;
      # below include file needs to be manually created at that path and to be uncommented
      # by removing the hash # in front of below line to take effect. This wpwhitelist_common.conf
      # allows you to add commonly shared settings to all wp plugin location matches which
      # whitelist php processing access at /usr/local/nginx/conf/wpincludes/edmdroid.com/wpsecure_edmdroid.com.conf
      #include /usr/local/nginx/conf/wpincludes/edmdroid.com/wpwhitelist_common.conf;
    }
    
    # Block PHP files in content directory.
    location ~* /wp-content/.*\.php$ {
      deny all;
    }
    
    # Block PHP files in includes directory.
    location ~* /wp-includes/.*\.php$ {
      deny all;
    }
    
    # Block PHP files in uploads, content, and includes directory.
    location ~* /(?:uploads|files|wp-content|wp-includes)/.*\.php$ {
      deny all;
    }
    
    # Make sure files with the following extensions do not get loaded by nginx because nginx would display the source code, and these files can contain PASSWORDS!
    location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_
    {
    return 444;
    }
    
    #nocgi
    location ~* \.(pl|cgi|py|sh|lua)$ {
    return 444;
    }
    
    #disallow
    location ~* (w00tw00t) {
    return 444;
    }
    
    location ~* /(\.|wp-config\.php|wp-config\.txt|changelog\.txt|readme\.txt|readme\.html|license\.txt) { deny all; }
    location ~* /(wp-content)/(.*?)\.(zip|gz|tar|bzip2|7z|txt)$ { deny all; }
    
    
     
  9. eva2000

    eva2000 Administrator Staff Member

    29,008
    6,580
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,770
    Local Time:
    11:27 PM
    Nginx 1.13.x
    MariaDB 5.5
  10. ivanc82

    ivanc82 New Member

    23
    2
    3
    Dec 1, 2015
    Ratings:
    +4
    Local Time:
    9:27 PM
    1.11.4
    MariaDB 10
    all good and it's working fine now

    Thanks a lot!