Join the community today
Become a Member

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

    121
    15
    18
    Jan 24, 2016
    Ratings:
    +39
    Local Time:
    11:44 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

    54,860
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    4:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    should go right after
    Code (Text):
       root /home/nginx/domains/domain.com/public;
    

    it won't affect xenforo