Want more timely Centmin Mod News Updates?
Become a Member

vBulletin Custom rewrite with VBSEO

Discussion in 'Forum software usage' started by STronic, Oct 10, 2014.

  1. STronic

    STronic New Member

    4
    1
    3
    Oct 10, 2014
    Ratings:
    +1
    Local Time:
    3:50 AM
    Hi,

    I'm moving a vBulletin forum with VBSeo :muted: to nginx but i'm with trouble with rewrites.

    I've followed this steps, but i can't get it working with pagination forums/threads

    In VBSEO URL Rewrite Settings i'm using ( 002 - Hierarchic directory type URLs with content relevant threads (used at Shared IP


    Where
    Forum URL is:
    Code:
    /f[forum_id]/
    And Forum Pagination URL is:
    Code:
    /f[forum_id]/index[forum_page].html
    Thread URL:
    Code:
    /f[forum_id]/[thread_title]-[thread_id]/
    Thread Pagination:
    Code:
    /f[forum_id]/[thread_title]-[thread_id]/index[thread_page].html
    Forum and Thread URLs are working, but pagination doesn't work.

    My .conf file:
    Code:
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    #server {
      #            listen   80;
      #            server_name audipt.com;
      #            return 301 $scheme://www.audipt.com$request_uri;
      #    }
    
      server {
        server_name audipt.com www.audipt.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;
        pagespeed off;
    
        # limit_conn limit_per_ip 16;
        # ssi  on;
    
        access_log /home/nginx/domains/audipt.com/log/access.log combined buffer=32k;
        error_log /home/nginx/domains/audipt.com/log/error.log;
    
        root /home/nginx/domains/audipt.com/public;
    
        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/errorpage.conf;
    
        location / {
    
          # block common exploits, sql injections etc
          #include /usr/local/nginx/conf/block.conf;
    
          # Enables directory listings when index file not found
          #autoindex  on;
    
          # Shows file listing times as local time
          #autoindex_localtime on;
    
          # Enable for vBulletin usage WITHOUT vbSEO installed
          #try_files            $uri $uri/ /index.php;
    
          rewrite ^/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ /vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;
          try_files $uri $uri/ /vbseo.php?$args;
    
        }
    
        location /includes {
          allow 127.0.0.1;
          deny all;
        }
    
        location /packages {
          allow 127.0.0.1;
          deny all;
        }
    
        location /vb {
          allow 127.0.0.1;
          deny all;
        }
    
        location /admincp {
          include /usr/local/nginx/conf/php.conf;
          #auth_basic "Private";
          #auth_basic_user_file /usr/local/nginx/conf/htpasswd;
        }
    
        location /vbseo/(includes|resources/html|resources/xml)/ {
          allow      127.0.0.1;
          deny      all;
        }
    
        location ~ /(.*\.php)$ {
          rewrite ^/(.*)$ /vbseo.php last;
        }
      }
    Someone can help me put the pagination working?
     
  2. eva2000

    eva2000 Administrator Staff Member

    53,190
    12,113
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,649
    Local Time:
    12:50 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    what do you mean doesn't work ? can you elaborate on symptoms and error codes you see ? 404 not found ?

    I suspect it's because you use vbseo with .html extension files as Centmin Mod has a static files include file at /usr/local/nginx/conf/staticfiles.conf which has a *.html extension location context matche as well as a match for other static file extensions. For performance, nginx should handle static files like html. But with vBSEO you are telling PHP-FPM should handle html files which reduces performance somewhat.

    you can type command shortcut below to use nano text editor to directly open and edit the staticfiles.conf file or edit it your own way i.e. via vim or vi editors.
    Code:
    statfilesinc
    Code:
        location ~* \.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso)$ {
        gzip_static off;
        #add_header Pragma public;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
        access_log off;
        expires 30d;
        break;
            }
    
        location ~* \.(js)$ {
        #add_header Pragma public;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
        access_log off;
        expires 30d;
        break;
            }
    
        location ~* \.(css)$ {
        #add_header Pragma public;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
        access_log off;
        expires 30d;
        break;
            }
    
        location ~* \.(html|htm|txt)$ {
        #add_header Pragma public;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
        access_log off;
        expires 1d;
        break;
            }
    
        location ~* \.(eot|svg|ttf|woff)$ {
        #add_header Pragma public;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
        access_log off;
        expires 30d;
        break;
            }
    then comment out the location match for html|htm|txt

    Code:
      #location ~* \.(html|htm|txt)$ {
        #add_header Pragma public;
        #add_header Cache-Control "public, must-revalidate, proxy-revalidate";
        #access_log off;
        #expires 1d;
        #break;
            #}
    then restart nginx web server.

    This will tell nginx not to server .html file extensions
     
  3. STronic

    STronic New Member

    4
    1
    3
    Oct 10, 2014
    Ratings:
    +1
    Local Time:
    3:50 AM
    Great!!
    I've created a new staticfiles.conf for this vhost without "html location" and it works!

    One more time, thanks for your help ;)
     
  4. eva2000

    eva2000 Administrator Staff Member

    53,190
    12,113
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,649
    Local Time:
    12:50 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Glad to hear it worked and great to see one of my fav vB themes on your site audipt.com - metro theme right ? or a different forum ?
     
  5. STronic

    STronic New Member

    4
    1
    3
    Oct 10, 2014
    Ratings:
    +1
    Local Time:
    3:50 AM
    Yap, is Metro Theme... the best for vB in my opinion.
     
  6. eva2000

    eva2000 Administrator Staff Member

    53,190
    12,113
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,649
    Local Time:
    12:50 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  7. rdan

    rdan Well-Known Member

    5,439
    1,397
    113
    May 25, 2014
    Ratings:
    +2,186
    Local Time:
    10:50 AM
    Mainline
    10.2
    And by the way, what about those sites that are listed on showcase area but not anymore using centminmod? :)