mitchellkrogza / nginx-ultimate-bad-bot-blocker

Nginx Block Bad Bots, Spam Referrer Blocker, Vulnerability Scanners, User-Agents, Malware, Adware, Ransomware, Malicious Sites, with anti-DDOS, Wordpress Theme Detector Blocking and Fail2Ban Jail for Repeat Offenders
Other
3.82k stars 472 forks source link

[INSTALLATION] My .vhost file isn't showing at step 4 #383

Open axzxc1236 opened 4 years ago

axzxc1236 commented 4 years ago

Did you look through existing ISSUES ?

I tried and I don't think I find a issue that's matching my issue.

Describe the problem you are experiencing

In step 4, I run the command sudo ./setup-ngxblocker to see what would change, my vhost file doesn't show up.

Yes I made sure the file ends with .vhost extension.

Error Messages

No error message but here is the command output from that commend


control@server:/usr/local/sbin$ sudo ./setup-ngxblocker
Checking url: https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/include_filelist.txt

** Dry Run ** | not updating files | run  as 'setup-ngxblocker -x' to setup files.

INFO:      /etc/nginx/conf.d/* detected               => /etc/nginx/nginx.conf

Checking for missing includes:

Checking url: https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/include_filelist.txt

Nothing to update for directory: /etc/nginx/conf.d
Nothing to update for directory: /etc/nginx/bots.d
Nothing to update for directory: /usr/local/sbin
Setting mode: 700 => /usr/local/sbin/install-ngxblocker
Setting mode: 700 => /usr/local/sbin/setup-ngxblocker
Setting mode: 700 => /usr/local/sbin/update-ngxblocker

Copy of nginx.conf


user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
    worker_connections 768;
    # multi_accept on;
}

http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    # server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    ##
    # SSL Settings
    ##

    ssl_protocols TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;

    ##
    # Logging Settings
    ##

    access_log /home/control/nginx-logs/access.log;
    error_log /home/control/nginx-logs/error.log;

    ##
    # Gzip Settings
    ##

    gzip on;

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

#mail {
#   # See sample authentication script at:
#   # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
# 
#   # auth_http localhost/auth.php;
#   # pop3_capabilities "TOP" "USER";
#   # imap_capabilities "IMAP4rev1" "UIDPLUS";
# 
#   server {
#       listen     localhost:110;
#       protocol   pop3;
#       proxy      on;
#   }
# 
#   server {
#       listen     localhost:143;
#       protocol   imap;
#       proxy      on;
#   }
#}

Copy of vhost / website / host .conf file

If applicable please paste your site/vhost configuration file in between the code ticks (paste in between the markers)

I blocked my domain name in the config file, I hope that's fine with you.


##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

#Weechat relay configuration
limit_req_zone $binary_remote_addr zone=weechat:10m rate=5r/m;

# server configuration
server {    
    # SSL configuration
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    ssl_certificate       /home/control/nginx-cert/fullchain;
    ssl_certificate_key   /home/control/nginx-cert/(my sub domain).duckdns.org.key;
    ssl_protocols TLSv1.2 TLSv1.3;# Requires nginx >= 1.13.0 else use TLSv1.2
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/nginx/dhparam.pem; # openssl dhparam -out /etc/nginx/dhparam.pem 4096
    ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
    ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
    ssl_session_timeout  10m;
    ssl_session_cache shared:SSL:10m;
    ssl_session_tickets off; # Requires nginx >= 1.5.9
    ssl_stapling on; # Requires nginx >= 1.3.7
    ssl_stapling_verify on; # Requires nginx => 1.3.7
    resolver 208.67.222.222 208.67.220.220 valid=300s;
    resolver_timeout 5s;
    add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
    add_header X-Frame-Options DENY;
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";
    server_name (my sub domain).duckdns.org;
    server_tokens off;

    location /weechat {
        proxy_pass http://localhost:9856/weechat; # Change the port to your relay's
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;   # These two lines ensure that the
        proxy_set_header Connection "Upgrade";    # a WebSocket is used
        proxy_read_timeout 604800;                # Prevent idle disconnects
        proxy_set_header X-Real-IP $remote_addr;  # Let WeeChat see the client's IP
        limit_req zone=weechat burst=1 nodelay;   # Brute force prevention
    }
}

Screenshots

(I don't think a screenshot would help here)

Server (please complete the following information):

It's a Ubuntu 20.04 server from Oracle Cloud.


Linux instance-20200523-1729 5.4.0-1011-oracle #11-Ubuntu SMP Mon May 11 16:58:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

nginx version: nginx/1.17.10 (Ubuntu)

I manage this Nginx server without any panel.

If I use -e * my vhost file shows up along with the default config file.

control@server:/usr/local/sbin$ sudo ./setup-ngxblocker -e *
/etc/nginx/sites-available/(my sub domain).duckdns.org.vhost
/etc/nginx/sites-available/default

Configure every file above as a vhost ? [Y/N] :

Additional information

*With `-e ` it shows up, but then it list both default file and my .vhost file**, I am not sure what to do.