• Resolved alexsina

    (@alexsina)


    Hello,

    We are using a tool to delpoy WordPress, please check the tool at wordops.net.

    This might be a special situation to install this plugin.

    It show like this:

    NGINX detected. In case you didn't add the code in the NGINX config already, please add the following line.
    
    include /var/www/xiaolaner.com/htdocs/hidemywp.conf;
    
    Don't forget to reload the Nginx service.
    
    Learn how to setup on Nginx server

    But sites-enabled option activated on our server, and it looks like this way:

    server {

    # Uncomment the following line for domain mapping
    # listen 80 default_server;

    server_name xiaolaner.com *.xiaolaner.com;

    # Uncomment the following line for domain mapping
    #server_name_in_redirect off;

    access_log /var/log/nginx/xiaolaner.com.access.log rt_cache_redis;
    error_log /var/log/nginx/xiaolaner.com.error.log;

    root /var/www/xiaolaner.com/htdocs;

    index index.php index.html index.htm;

    include common/redis-php74.conf;
    include common/wpsubdir.conf;
    include common/wpcommon-php74.conf;
    include common/locations-wo.conf;
    include /var/www/xiaolaner.com/conf/nginx/*.conf;

    }

    and I tried adding both following ways, but no luck:

    1# Only add
    include path-to-file/hidemywp.conf;
    2# add all of below content:

    include path-to-file/hidemywp.conf;
    
            location / {
                    try_files $uri $uri/ /index.php?$args;
            }

    Nginx will not work, Anyway to resolve please?

    Thanks

    • This topic was modified 3 years, 9 months ago by alexsina.
    • This topic was modified 3 years, 9 months ago by alexsina.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter alexsina

    (@alexsina)

    Here is the content of Nignx.conf for your referance:

    user www-data;
    worker_processes auto;
    worker_cpu_affinity auto;
    worker_rlimit_nofile 100000;
    pid /run/nginx.pid;
    
    pcre_jit on;
    
    events {
            multi_accept on;
            worker_connections 50000;
            accept_mutex on;
            use epoll;
    }
    
    http {
            ##
            # WordOps Settings - WordOps 3.13.2
            ##
    
            keepalive_timeout 8;
    
            # Nginx AIO : See - https://www.nginx.com/blog/thread-pools-boost-performance-9x/
            # https://nginx.org/en/docs/http/ngx_http_core_module.html#aio
            aio threads;
    
            server_tokens off;
            reset_timedout_connection on;
            more_set_headers "X-Powered-By : WordOps";
    
    # Limit Request
            limit_req_status 403;
            limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
            limit_req_zone $binary_remote_addr zone=two:10m rate=10r/s;
    
            # Proxy Settings
            # set_real_ip_from      proxy-server-ip;
            # real_ip_header        X-Forwarded-For;
    
            fastcgi_read_timeout 300;
            client_max_body_size 100m;
    
            # ngx_vts_module
            vhost_traffic_status_zone;
    
            # tls dynamic records patch directive
            ssl_dyn_rec_enable on;
    
            ##
            # SSL Settings
            ##
    
            # Enable 0-RTT support for TLS 1.3
            proxy_set_header Early-Data $ssl_early_data;
            ssl_early_data on;
    
            ssl_session_timeout 1d;
            ssl_session_cache shared:SSL:50m;
            ssl_session_tickets off;
            ssl_prefer_server_ciphers on;
    
    ssl_ciphers '';
            ssl_protocols TLSv1.2 TLSv1.3;
            ssl_ecdh_curve X25519:P-521:P-384:P-256;
    
            # Common security headers
            more_set_headers "X-Frame-Options : SAMEORIGIN";
            more_set_headers "X-Xss-Protection : 1; mode=block";
            more_set_headers "X-Content-Type-Options : nosniff";
            more_set_headers "Referrer-Policy : no-referrer, strict-origin-when-cross-origin";
            more_set_headers "X-Download-Options : noopen";
    
            # oscp settings
            resolver 8.8.8.8 1.1.1.1 8.8.4.4 1.0.0.1 valid=300s;
            resolver_timeout 10;
            ssl_stapling on;
    
            ##
            # Basic Settings
            ##
            # server_names_hash_bucket_size 64;
            # server_name_in_redirect off;
    
            include /etc/nginx/mime.types;
            default_type application/octet-stream;
    
    ##
            # Logging Settings
            ##
    
            access_log off;
            error_log /var/log/nginx/error.log;
    
            # Log format Settings
            log_format rt_cache '$remote_addr $upstream_response_time $upstream_cache_status [$time_local] '
            '$http_host "$request" $status $body_bytes_sent '
            '"$http_referer" "$http_user_agent" "$server_protocol"';
    
            ##
            # Virtual Host Configs
            ##
    
            include /etc/nginx/conf.d/*.conf;
            include /etc/nginx/sites-enabled/*;
    
    }
    • This reply was modified 3 years, 9 months ago by alexsina.
    Plugin Author John Darrel

    (@johndarrel)

    Hi,

    Thank you for your question.

    As you see in the Hide My WP notification, you need to include this line in Nginx config.

    include /var/www/xiaolaner.com/htdocs/hidemywp.conf;

    You should add the line like this:

    server {
    
    # Uncomment the following line for domain mapping
    # listen 80 default_server;
    
    server_name xiaolaner.com *.xiaolaner.com;
    
    # Uncomment the following line for domain mapping
    #server_name_in_redirect off;
    
    access_log /var/log/nginx/xiaolaner.com.access.log rt_cache_redis;
    error_log /var/log/nginx/xiaolaner.com.error.log;
    
    root /var/www/xiaolaner.com/htdocs;
    
    index index.php index.html index.htm;
    
    include /var/www/xiaolaner.com/htdocs/hidemywp.conf;
    
    include common/redis-php74.conf;
    include common/wpsubdir.conf;
    include common/wpcommon-php74.conf;
    include common/locations-wo.conf;
    include /var/www/xiaolaner.com/conf/nginx/*.conf;
    
    }

    Don’t forget to restart the Nginx config like in this tutorial:

    https://hidemywpghost.com/how-to-configure-hide-my-wp-on-nginx-web-server-with-virtual-private-server/

    Thread Starter alexsina

    (@alexsina)

    Hello,

    I am confused.

    Threre are three sites on one server, did you check the content of Nignx.conf of my second post please?

    The content of your quotation is from the sites-enabled conf file.

    Would you please check again?

    Plugin Author John Darrel

    (@johndarrel)

    For the site based config, you need to check the Nginx config in the directory

    /etc/nginx/sites-enabled/

    with the name of the website.

    You will add the include line for hidemywp as specified in this tutorial:

    https://hidemywpghost.com/how-to-configure-hide-my-wp-on-nginx-web-server-with-virtual-private-server/

    Note! don’t forget to change the ‘path-to-file’ with the actual file path from your website directory.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Nginx setting does not work’ is closed to new replies.