Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Wordpress + Nginx Tags issue.
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Wordpress + Nginx Tags issue.

CoreyCorey Member
edited January 2013 in General

So I have wordpress installed on nginx as seen at http://www.bitaccel.com/blog
Everything is working properly except for one thing....

TAGS

The only tag that will work is the dallas-vps one.
http://www.bitaccel.com/blog/go/dallas-vps/

Any other tag on that blog will not work - here is the configuration for that site...

server { server_name bitaccel.com www.bitaccel.com; root /var/www/bitaccel.com; include /etc/nginx/fastcgi_php; location / { index index.php; } location /blog { index index.php; try_files $uri $uri/ /blog/index.php?$args; } location /blog/go { try_files $uri $uri/ /blog/index.php?$args; } }

I'm not sure how to get the tags working properly. Can anyone provide some insight?

Comments

  • Give this a try --

    # Enable permalink structures
    if (!-e $request_filename) {
        rewrite . /index.php last;
    }
    
  • CoreyCorey Member
    edited January 2013

    @connercg said: # Enable permalink structures

    if (!-e $request_filename) {
    rewrite . /index.php last;
    }

    Permalinks are working - and this does not work for me with the version of nginx I am using. I tried that first thing from the LEB post.

  • I would have thought tags would have been considered part of the permalink structure.

    @kbreezie may be able to give you a hand.

  • @connercg said: I would have thought tags would have been considered part of the permalink structure.

    @kbreezie may be able to give you a hand.

    Me too which is why I'm puzzled as to why this doesn't work.

    Access log just shows me 404 - and error log doesn't show anything.

  • I had a few issues with tags one one of my sites - my working config is:

    [code]

    server {
    listen 80;
    server_name xxxxxxxxxxxx.com;

    rewrite ^/(.*) http://www.xxxxxxxxxxxx.com/$1 permanent;
    

    }

    server {
    listen 80;
    server_name www.xxxxxxxxxxxx.com;

    client_max_body_size 20M;
    
    access_log /home/prae/http/logs/access_log-xxxxxxxxxxxx.com.log;
    error_log /home/prae/http/logs/error_log-xxxxxxxxxxxx.com.log;
    index index.html index.php;
    try_files $uri $uri/ /index.php?q=$uri&$args;
    root /home/prae/http/hosts/xxxxxxxxxxxx.com/wordpress/;
    
    include /etc/nginx/conf.d/cache.conf;
    include /etc/nginx/conf.d/deny.conf;
    include /etc/nginx/php.d/prae.conf;
    

    }

  • @prae5 said: I had a few issues with tags one one of my sites - my working config is:

    [code]

    server {

    listen 80;
    server_name xxxxxxxxxxxx.com;

    rewrite ^/(.*) http://www.xxxxxxxxxxxx.com/$1 permanent;

    }

    server {

    listen 80;
    server_name www.xxxxxxxxxxxx.com;

    client_max_body_size 20M;

    access_log /home/prae/http/logs/access_log-xxxxxxxxxxxx.com.log;

    error_log /home/prae/http/logs/error_log-xxxxxxxxxxxx.com.log;
    index index.html index.php;
    try_files $uri $uri/ /index.php?q=$uri&$args;
    root /home/prae/http/hosts/xxxxxxxxxxxx.com/wordpress/;

    include /etc/nginx/conf.d/cache.conf;

    include /etc/nginx/conf.d/deny.conf;
    include /etc/nginx/php.d/prae.conf;
    }

    /index.php?q=$uri&$args;

    $uri contains what? I'm thinking this is the fix here.

  • @prae5 said: /index.php?q=$uri&$args

    Turns out this section did not fix anything.

  • Not sure if its relevant, but I also have my permalinks set to /%postname%/

    What does your log show when you get the 404?

  • @prae5 said: Not sure if its relevant, but I also have my permalinks set to /%postname%/

    What does your log show when you get the 404?

    Yea I tried some of your other directives and they didn't help either.
    The log shows this....

    173.0.36.144 - - [15/Jan/2013:13:24:42 -0600] "-" 400 0 "-" "-" 173.0.36.144 - - [15/Jan/2013:13:24:42 -0600] "-" 400 0 "-" "-" 173.0.36.144 - - [15/Jan/2013:13:24:42 -0600] "-" 400 0 "-" "-" 173.0.36.144 - - [15/Jan/2013:13:25:22 -0600] "GET /blog/go/buffalo/ HTTP/1.1" 404 3376 "http://www.bitaccel.com/blog/vps-launch-in-buffalo-new-york-delayed/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11"

  • japonjapon Member
    edited January 2013

    @Corey said: Everything is working properly except for one thing.... TAGS

    Have a look at the following:

  • CoreyCorey Member
    edited January 2013

    @japon said: @Corey said: Everything is working properly except for one thing.... TAGS

    Have a look at the following:

    • From Apache2 to NGINX with Wordpress
    • NGINX Helper
    • NGINX Compatibility

    Already using NGINX compat && NGINX helper. I can't see anything in that article different that would make a difference.

    Here is my config right now...

    server { server_name bitaccel.com www.bitaccel.com; root /var/www/bitaccel.com; include /etc/nginx/fastcgi_php; location / { index index.php; } location /blog { index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; try_files $uri $uri/ /blog/index.php?q=$uri&$args; } }

  • Try this:

            location /blog {
                    try_files $uri $uri/ /index.php;
            }
    
  • CoreyCorey Member
    edited January 2013

    @ihatetonyy said: Try this:

       location /blog {
    

    try_files $uri $uri/ /index.php;
    }

    That wouldn't pass any args (url path info etc) into index.php would it? Trying now.

    Edit: Yea none of the info was passed into index.php then.

  • I think you may be missing a forward slash in the location block

    location /blog

    should be:

    location /blog/

    and same for the other one.

  • @Dudeist said: I think you may be missing a forward slash in the location block

    location /blog

    should be:

    location /blog/

    and same for the other one.

    Still says nothing found for this config -
    server { server_name bitaccel.com www.bitaccel.com; root /var/www/bitaccel.com; include /etc/nginx/fastcgi_php; location / { index index.php; } location /blog/ { index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; try_files $uri $uri/ /blog/index.php?q=$uri&$args; } }

  • @Corey

    location /blog/ { index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; try_files $uri $uri/ /blog/index.php?q=$uri&$args; }

    should be

    location /blog/ { index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; try_files $uri $uri/ /index.php?q=$uri&$args; }

  • @Dudeist said: should be

    location /blog/ {

    index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    No it shouldn't because it sends it to bitaccel.com/index.php

  • Anymore suggestions? This is LET I figured it would be the perfect place to ask.

  • Try the nginx mailing list/forum, they are really helpful.

  • The key is to use try_files on index.php?q=$uri&$args, everything appears to work just fine here.

    If it isn't working, something else is most likely broken. Try the nginx mailing list, or StackExchange, both should get it done.

    You could consider hiring a sysadmin too if you're lazy, upto you.

  • @Wintereise said: The key is to use try_files on index.php?q=$uri&$args, everything appears to work just fine here.

    See that is what I'm doing. Do you mind pasting your configuration here for me?

  • CoreyCorey Member
    edited January 2013

    I figured it out - Category base and Tag base were both set to 'go' and this was making it send tags to 404.

    I just set category base to 'cat' and tag base to 'go' and now everything works fine. Thank you all for your help!

    I figured it out from the bottom post here -
    http://wordpress.org/support/topic/post-tags-not-working-2

    and then followed to here -> http://codex.wordpress.org/Using_Permalinks#Category_base_and_Tag_base

Sign In or Register to comment.