Results 1 to 10 of 10

Making sure that nginx serves wordpress, php, and my node.js application?

This is a discussion on Making sure that nginx serves wordpress, php, and my node.js application? within the General Discussion forums, part of the vBSEO SEO Plugin category; CompassionPit.com is a Node. js app. The CompassionPit blog is WordPress and the CompassionPit forum is VBulletin. Everything was working ...

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    5
    Liked
    0 times

    Making sure that nginx serves wordpress, php, and my node.js application?

    CompassionPit.com is a Node.js app. The CompassionPit blog is WordPress and the CompassionPit forum is VBulletin. Everything was working fine and dandy until I installed the VBseo plugin for VBulletin, which wants me to add these lines to my nginx configuration:


    Code:
            location /forum/ {
                    rewrite ^/forum/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ /forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;
                    try_files $uri $uri/ /forum/vbseo.php?$args;
            }
    
    
            location ~ /forum/(.*\.php)$ {
                    rewrite ^/forum/(.*)$ /forum/vbseo.php last;
            }
            location /forum/vbseo/(includes|resources/html|resources/xml)/ {
                    allow      127.0.0.1;
                    deny      all;
            }

    Here's the updated configuration file, including the 3 new blocks, which I placed at the bottom of the file.


    Code:
        server {
            listen       80;                # your server's public IP address
            server_name  www.compassionpit.com;
            index        index.php index.html;
    
    
            location ~ ^/$ {
                proxy_pass http://127.0.0.1:8000;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                break;
            }
    
    
            location @blogphp {
                internal;
                root /opt/blog;
                include fastcgi_params;
                fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
                fastcgi_index  index.php;
                fastcgi_pass   127.0.0.1:8080;
                break;
            }
    
    
            location ~ ^/(forum|blog)/($|.*\.php) {
                root /opt/;
                include fastcgi_params;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                fastcgi_index  index.php;
                fastcgi_pass   127.0.0.1:8080;
                break;
            }
    
    
            location ~ ^/(blog|forum) {
                root /opt/;
                try_files $uri $uri/ @blogphp;
                break;
            }
    
    
            location ~ ^/(forum|blog|vbulletin)/ {
               root /opt/;
               break;
            }
    
    
            location @backend {
                internal;
                proxy_pass http://127.0.0.1:8000;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                break;
            }
    
    
            location ~ / {
                root /opt/chat/static/;
                try_files $uri $uri/ @backend;
                break;
            }
    
    
    
    
    
    
    
    
            location /forum/ {
                    rewrite ^/forum/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ /forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;
                    try_files $uri $uri/ /forum/vbseo.php?$args;
            }
    
    
            location ~ /forum/(.*\.php)$ {
                    rewrite ^/forum/(.*)$ /forum/vbseo.php last;
            }
            location /forum/vbseo/(includes|resources/html|resources/xml)/ {
                    allow      127.0.0.1;
                    deny      all;
            }
    
    
        }

    You see, http://www.compassionpit.com/forum/general-discussion/ is getting served by WordPress.


    Any suggestions for how I can condense the nginx file to integrate the VBSEO changes?


    Thank you!


    --Zachary

  2. #2
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,100
    Liked
    622 times
    Blog Entries
    4
    You have many conflicts within your rules. What are your required rules for wordpress ?
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  3. #3
    Junior Member
    Join Date
    Sep 2011
    Posts
    5
    Liked
    0 times
    Quote Originally Posted by Mert Gökçeimam View Post
    You have many conflicts within your rules. What are your required rules for wordpress ?
    I have no idea what the required rules for wordpress are.
    I am waiting for someone who understands nginx cold to weigh in.
    I do not understand nginx.

  4. #4
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    location ~ ^/(blog|forum) { root /opt/; try_files $uri $uri/ @blogphp; break; }


    You're sending both the blog and the forum to the samep place. Why did you add forum here?

    Basically, you should NEVER have the forum path sharing the same rules as the blog.

    Restore what you had previously for the blog and then just add in the forum rules for vbseo

  5. #5
    Junior Member
    Join Date
    Sep 2011
    Posts
    5
    Liked
    0 times
    Quote Originally Posted by Brian Cummiskey View Post
    location ~ ^/(blog|forum) { root /opt/; try_files $uri $uri/ @blogphp; break; }


    You're sending both the blog and the forum to the samep place. Why did you add forum here?

    Basically, you should NEVER have the forum path sharing the same rules as the blog.

    Restore what you had previously for the blog and then just add in the forum rules for vbseo
    I changed that to

    location ~ ^/blog { root /opt; try_files $uri $uri/ @blogphp; break; }

    and then I enabled VBSeo in the plugins

    And then I tried to go to http://www.compassionpit.com/forum/general-discussion/

    And it gave me a 404 not found.

    Looking in tail /var/log/nginx/error.log, I see:

    2011/09/09 13:53:30 [error] 32578#0: *74 "/opt/forum/general-discussion/index.php" is not found (2: No such file or directory), client: 207.237.114.16, server: Compassion Pit, request: "GET /forum/general-discussion/ HTTP/1.1", host: "www.compassionpit.com", referrer: "http://www.compassionpit.com/forum/"

    And that's true... since there is no file like that, there.

    Can someone who understands nginx just tell me how to set up my config file?

    And if not, that's totally cool, how do I contact the PHP-SEO people for a refund? Not worth the time-sink at this point. I would pay for an nginx consultant but I don't know where to find one.

  6. #6
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    We do not support the other systems or their rules. Our rule file works on its own. I would suggest using our root file alone, and then working in the other systems around it.

  7. #7
    Junior Member
    Join Date
    Sep 2011
    Posts
    5
    Liked
    0 times
    Quote Originally Posted by Brian Cummiskey View Post
    We do not support the other systems or their rules. Our rule file works on its own. I would suggest using our root file alone, and then working in the other systems around it.
    OK, I'm willing to throw out the blog, but can you tell me how to just integrate my application + your rule file...?

  8. #8
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,100
    Liked
    622 times
    Blog Entries
    4
    Did you check readme.html for installation instructions ?
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  9. #9
    Junior Member
    Join Date
    Sep 2011
    Posts
    5
    Liked
    0 times
    Quote Originally Posted by Mert Gökçeimam View Post
    Did you check readme.html for installation instructions ?
    Yes. However since I am running a Node.js application on port 8000, instead of a PHP application, installation is not straightforward

  10. #10
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    You should probably try to find an nginx configuration expert to help you out as your system is non-standard.

Similar Threads

  1. yahoo application id - application url?
    By curriertech in forum General Discussion
    Replies: 20
    Last Post: 08-12-2007, 12:30 PM
  2. Submitted Application
    By KW802 in forum vBSEO Affiliate Program
    Replies: 21
    Last Post: 02-05-2007, 08:29 AM
  3. application...
    By Ohiosweetheart in forum vBSEO Affiliate Program
    Replies: 8
    Last Post: 12-08-2006, 09:39 PM

Posting Permissions

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