Learn about Centmin Mod LEMP Stack today
Register Now

Xenforo XenForo on main domain and WP on sub directory vhost

Discussion in 'Forum software usage' started by pdinh97qng, Aug 22, 2018.

  1. pdinh97qng

    pdinh97qng Member

    41
    5
    8
    Jan 24, 2016
    Ratings:
    +9
    Local Time:
    12:48 PM
    This is my vhost
    Code (Text):
    server {
        listen 178.128.80.32:80;
        listen [2400:6180:0:d1::512:2001]:80;
        server_name domain.com www.domain.com;
        return 301 https://www.domain.com$request_uri;
        }
    server {
        listen 178.128.80.32:443 ssl http2;
        listen [2400:6180:0:d1::512:2001]:443 ssl http2;
        server_name domain.com;
        return 301 https://www.domain.com$request_uri;
        include /usr/local/nginx/conf/ssl/domain.com/domain.com.crt.key.conf;
        include /usr/local/nginx/conf/ssl_include.conf;
        }
    server {
        listen 178.128.80.32:443 ssl http2;
        listen [2400:6180:0:d1::512:2001]:443 ssl http2;
        server_name www.domain.com;
        include /usr/local/nginx/conf/ssl/domain.com/domain.com.crt.key.conf;
        include /usr/local/nginx/conf/ssl_include.conf;
        http2_max_field_size 16k;
        http2_max_header_size 32k;
        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 Strict-Transport-Security "max-age=31536000; includeSubdomains;";
        ssl_buffer_size 1369;
        ssl_session_tickets on;
        resolver 8.8.8.8 8.8.4.4 valid=10m;
        resolver_timeout 10s;
        ssl_stapling on;
        ssl_stapling_verify on;
        #include /usr/local/nginx/conf/pagespeed.conf;
        #include /usr/local/nginx/conf/pagespeedhandler.conf;
        #include /usr/local/nginx/conf/pagespeedstatslog.conf;
        access_log /home/nginx/domains/domain.com/log/access.log combined buffer=256k flush=5m;
        error_log /home/nginx/domains/domain.com/log/error.log;
        include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
        root /home/nginx/domains/domain.com/public;
        include /usr/local/nginx/conf/503include-main.conf;
        location / {
            include /usr/local/nginx/conf/503include-only.conf;
            try_files $uri $uri/ /index.php?$uri&$args;
            index index.php index.html;
            }
        location /community/install/data/ {
            internal;
            allow 127.0.0.1;
            deny all;
            }
        location /community/install/templates/ {
            internal;
            allow 127.0.0.1;
            deny all;
            }
        location /community/internal_data/ {
            internal;
            allow 127.0.0.1;
            deny all;
            }
        location /community/library/ {
            internal;
            allow 127.0.0.1;
            deny all;
            }
        location /community/src/ {
            internal;
            allow 127.0.0.1;
            deny all;
            }
        location ~ ^/(admin.php) {
            include /usr/local/nginx/conf/php.conf;
            }
        location /blog {
            include /usr/local/nginx/conf/503include-only.conf;
            include /usr/local/nginx/conf/wpincludes/domain.com/wpsecure_domain.com.conf;
            try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;
            }
        location ~* /blog/(wp-login\.php) {
            limit_req zone=xwplogin burst=1 nodelay;
            include /usr/local/nginx/conf/php-wpsc.conf;
            }
        location ~* /blog/(xmlrpc\.php) {
            limit_req zone=xwprpc burst=45 nodelay;
            include /usr/local/nginx/conf/php-wpsc.conf;
            }
        location ~* /blog/wp-admin/(load-scripts\.php) {
            limit_req zone=xwprpc burst=5 nodelay;
            include /usr/local/nginx/conf/php-wpsc.conf;
            }
        location ~* /blog/wp-admin/(load-styles\.php) {
            limit_req zone=xwprpc burst=5 nodelay;
            include /usr/local/nginx/conf/php-wpsc.conf;
            }
        include /usr/local/nginx/conf/pre-staticfiles-local-domain.com.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/vts_server.conf;
        }
    

    I saw this line but don't know where to put this into my vhost since i don't want this to have affect my XenForo
    Code (Text):
    include /usr/local/nginx/conf/wpincludes/vietfriend.org/wpcacheenabler_domain.com.conf;
    

     
  2. eva2000

    eva2000 Administrator Staff Member

    37,354
    8,162
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,563
    Local Time:
    6:48 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    should go right after
    Code (Text):
       root /home/nginx/domains/domain.com/public;
    

    it won't affect xenforo
     
..