Page 2 of 2 FirstFirst 1 2
Results 16 to 23 of 23
Like Tree5Likes

howto for nginx

This is a discussion on howto for nginx within the General Discussion forums, part of the vBulletin SEO Discussion category; Originally Posted by Stubbed IfIsEvil ^-- With that in mind, is there another way to achieve this? Would also like ...

  1. #16
    Junior Member
    Real Name
    Mike
    Join Date
    Jun 2009
    Posts
    8
    Liked
    0 times
    Quote Originally Posted by Stubbed View Post
    IfIsEvil
    ^-- With that in mind, is there another way to achieve this?
    Would also like this.

  2. #17
    Junior Member
    Real Name
    stubbed
    Join Date
    Mar 2009
    Posts
    9
    Liked
    1 times
    FYI - the latest vBSEO download includes nginx redir rules...

  3. #18
    Junior Member
    Real Name
    stubbed
    Join Date
    Mar 2009
    Posts
    9
    Liked
    1 times
    But... They're a bit sick. I won't bother with a support request as this is just on my testing site (Obviously will log one if required), but the ones that came with the download return 500 error.

    Supplied with 3.6.0:
    Code:
    location /forums/ {
    rewrite ^/forums/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ /forums/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;
    
    try_files $uri $uri/ /forums/vbseo.php?$args;
    }
    
    location ~ /forums/(.*\.php)$ {
    rewrite ^/forums/(.*)$ /forums/vbseo.php last;
    }
    location /forums/vbseo/(includes|resources/html|resources/xml)/ {
        allow      127.0.0.1;
        deny      all;
    }
    Error from logs:
    Code:
    2011/05/07 15:31:11 [error] 12304#0: *35 rewrite or internal redirection cycle while processing "/forums/vbseo.php", client: 123.xxx.xxx.xxx, server: site.com, request: "GET /forums/vbseocp.php HTTP/1.1", host: "site.com", referrer: "http://site.com/forums/admincp/index.php?do=nav"
    ^-- I realise that's from the admincp but it was the same on the forum.

    From nginx docs:
    If the directives of this module are given at the server level, then they are carried out before the location of the request is determined. If in that selected location there are further rewrite directives, then they also are carried out. If the URI changed as a result of the execution of directives inside location, then location is again determined for the new URI.

    This cycle can be repeated up to 10 times, after which Nginx returns a 500 error.
    Looking at that, it looks like it's hitting the first location, and then the second one, and so on and so on. Removing the second location directive makes everything operable again, and I can't figure out a situation where you would need the location of "~ /forums/(.*\.php)$" over just "/forums/" ?

    What am I missing here?

  4. #19
    Member
    Real Name
    Webbstre
    Join Date
    Dec 2009
    Posts
    35
    Liked
    2 times
    I'm going to bump this thread since it will probably save me some time. I have the exact problem of the last person who posted before me. Does anyone know how to fix this?

  5. #20
    Junior Member
    Real Name
    stubbed
    Join Date
    Mar 2009
    Posts
    9
    Liked
    1 times
    I can't remember the exact outcome, but these were the rules provided to me by vBSEO that worked (I also moved my /forum/ directory to just /, which is the first rule):

    Code:
            location /forum/ {
                    rewrite ^/forum/(.*)$ http://site.com/$1 permanent;
            }
    
            location / {
                    rewrite ^/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ /vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;
                    try_files $uri $uri/ /vbseo.php?$args;
            }
    
            location /vbseo/(includes|resources/html|resources/xml)/ {
                    allow      127.0.0.1;
                    deny      all;
            }
    
            location ~ \.php$ {
                    try_files               $uri =404;
                    fastcgi_split_path_info ^(.+\.php)(/.+)$;
                    fastcgi_pass            unix:/tmp/php5.sock;
                    fastcgi_param SCRIPT_FILENAME $document_root/vbseo.php;
                    fastcgi_param PATH_INFO $fastcgi_path_info;
                    fastcgi_param PATH_TRANSLATED $document_root/vbseo.php;
                    include                 fastcgi_params;
            }
    The problem was this broke a lot of third party apps that I had that had to be inside my forum directory in order to integrate with vBulletin, which is a shame. Default fastcgi_params file.

  6. #21
    Member
    Real Name
    Webbstre
    Join Date
    Dec 2009
    Posts
    35
    Liked
    2 times
    Thanks for this! I tried this, and it kept breaking, but when I removed everything starting with the "location ~ \.php$ {" to the end everything started working correctly. When I tried loading it with it I was getting a message in shell about fastcgi not being able to open.

    So... without that last part everything appears to work properly, so was it really necessary? Or will I run into problems later?

  7. #22
    Junior Member
    Real Name
    stubbed
    Join Date
    Mar 2009
    Posts
    9
    Liked
    1 times
    That is the php block, you would only have one php block in each nginx site config, so you must have doubled up by just coping the rules I already had.

    Removing one is fine.

  8. #23
    Member
    Real Name
    Webbstre
    Join Date
    Dec 2009
    Posts
    35
    Liked
    2 times
    Excellent. Thanks for the help!

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. nginx
    By fras in forum General Discussion
    Replies: 3
    Last Post: 01-25-2008, 06:57 PM
  2. Using config_vbseo.php in different environments - HOWTO?
    By eliot in forum General Discussion
    Replies: 1
    Last Post: 03-29-2007, 03:13 PM
  3. Sitemap HowTo?
    By sixtyseven in forum Deutsch
    Replies: 14
    Last Post: 03-25-2006, 07:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •