Plesk 11.5.3 , NGINX Conf problem

Discussion in 'Plesk 11.x for Linux' started by A.Chakery, Jul 11, 2013.

  1. A.Chakery

    A.Chakery Basic Pleskian

    12
    85%
    Joined:
    Oct 18, 2012
    Messages:
    30
    Likes Received:
    1
    Hello,

    recently I upgraded my plesk to 11.5.3 .. I have one wordpress website and one vBulletin ...

    I don't know where and how to enter the needed nginx conf for wordpress -OR- vBulletin in my plesk (or using SSH)

    would you please recommend what to do ?

    I tried this box but it gives me an error .... (domain.com > webserver settings > Additional nginx directives )

    Here is my code (for wordpress : )

    Code:
    location / {
     
    root /var/www/vhosts/domain.com/httpdocs;
    index index.php index.html index.htm;
     
    # Wordpress permalinks
    if (!-e $request_filename) {
    rewrite ^(.*)$ /index.php?q=$1 last;
    break;
    }
     
    }
    and this is the error :


    any help is really appreciated ...
     
  2. Nikolay.

    Nikolay. Silver Pleskian

    17
    35%
    Joined:
    Jul 1, 2012
    Messages:
    844
    Likes Received:
    2
    Such custom directives are added on server {} level. And duplicate locations are not allowed, apparently. You can add following instead, but this will probably wreck your static files processing:

    Code:
    # Wordpress permalinks
    if (!-e $request_filename) {
      rewrite ^(.*)$ /index.php?q=$1 last;
      break;
    }
    
    Needs more thinking on how to do it properly.

    Are you using php-fpm and therefore having problems with permalinks?
     
  3. Nikolay.

    Nikolay. Silver Pleskian

    17
    35%
    Joined:
    Jul 1, 2012
    Messages:
    844
    Likes Received:
    2
    BTW, I just tested permalinks in Wordpress under php-fpm with static files served directly by nginx and it works properly out of the box.

    What am I doing wrong? I have WP 3.5.2 and latest Plesk 11.5.30, php-fpm 5.3.26 from dotdeb under Debian 6 i386.

    Maybe you don't want to use PATHINFO permalinks?
     
    Last edited: Jul 11, 2013
  4. A.Chakery

    A.Chakery Basic Pleskian

    12
    85%
    Joined:
    Oct 18, 2012
    Messages:
    30
    Likes Received:
    1
    thank you very much for the reply ...

    I am using CentOS 6.4 / php-fpm / WP 3.5.2

    I don't get what do you mean by path info ... here is the permalink that I am using : /%postname%/

    Thanks again


    oh and what about vBulletin... I have vbseo plugin and they said that I have to use these config codes in my nginx conf file .. and I really have no idea what to do ...

    vBSEO rewrite rules :
    Code:
          location /
            {
                    index                           index.php index.html;
                    rewrite ^/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ /vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;
    
                    if (!-e $request_filename)
                    {
                            rewrite ^/(.*)$ /vbseo.php last;
                    }
            }
            if ($request_filename ~ "\.php$" )
            {
                  rewrite ^/([^/]*)$ /vbseo.php last;
            }
    
    
     
  5. A.Chakery

    A.Chakery Basic Pleskian

    12
    85%
    Joined:
    Oct 18, 2012
    Messages:
    30
    Likes Received:
    1
    Any help is really appreciated !!
     
  6. Nikolay.

    Nikolay. Silver Pleskian

    17
    35%
    Joined:
    Jul 1, 2012
    Messages:
    844
    Likes Received:
    2
  7. A.Chakery

    A.Chakery Basic Pleskian

    12
    85%
    Joined:
    Oct 18, 2012
    Messages:
    30
    Likes Received:
    1
    Thank you very much for the reply...

    it give me this error :

    when I try to save this code :

    Code:
    gzip_proxied any;
    location ^~ / {
            index index.html index.php;
            try_files $uri $uri/ /index.php?$args;
    
            # This location should be exact copy of the one from /etc/nginx/plesk.conf.d/vhosts/domain.tld.conf
            location ~ ^/(.*\.(ac3|avi|bmp|bz2|css|cue|dat|doc|docx|dts|exe|flv|gif|gz|htm|html|ico|img|iso|jpeg|jpg|js|mkv|mp3|mp4|mpeg|mpg|ogg|pdf|png|ppt|pptx|qt|rar|rm|swf|tar|tgz|txt|wav|xls|xlsx|zip))$ {
                    try_files $uri @fallback;
            }
            # This location should be exact copy of the one from /etc/nginx/plesk.conf.d/vhosts/domain.tld.conf
            location ~ \.php(/.*)?$ {
                    fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
                    fastcgi_param PATH_INFO $fastcgi_path_info;
                    fastcgi_pass "unix:/var/www/vhosts/system/aionets.com/php-fpm.sock";
                    include /etc/nginx/fastcgi.conf;
            }
    }
    
    any suggestions ?


    thanks again
     
  8. A.Chakery

    A.Chakery Basic Pleskian

    12
    85%
    Joined:
    Oct 18, 2012
    Messages:
    30
    Likes Received:
    1
    ok finally I managed to save it but I still have niginx not found page .... please help ......
     
  9. sgala.matteo

    sgala.matteo New Pleskian

    10
    35%
    Joined:
    Jun 5, 2012
    Messages:
    8
    Likes Received:
    0
    have you found a solution?

    M.
     
  10. A.Chakery

    A.Chakery Basic Pleskian

    12
    85%
    Joined:
    Oct 18, 2012
    Messages:
    30
    Likes Received:
    1
    Unfortunately no ...
     
  11. Kingsley

    Kingsley Regular Pleskian

    16
    35%
    Joined:
    Dec 13, 2014
    Messages:
    344
    Likes Received:
    9
    Location:
    Nigeria
    Am having 404 error page
     
  12. A.Chakery

    A.Chakery Basic Pleskian

    12
    85%
    Joined:
    Oct 18, 2012
    Messages:
    30
    Likes Received:
    1
    Try to use new NGiNX htaccess converter which is implanted in Plesk 12 .. it almost solved my problem and my WP permalinks are working ...

    First you need to activate it in add-ons and after that you can utilize it in web server configurations .
     
  13. Kingsley

    Kingsley Regular Pleskian

    16
    35%
    Joined:
    Dec 13, 2014
    Messages:
    344
    Likes Received:
    9
    Location:
    Nigeria
    Do you have the link or step?
     
  14. Kingsley

    Kingsley Regular Pleskian

    16
    35%
    Joined:
    Dec 13, 2014
    Messages:
    344
    Likes Received:
    9
    Location:
    Nigeria
    Also which of the above code did you use
     
  15. A.Chakery

    A.Chakery Basic Pleskian

    12
    85%
    Joined:
    Oct 18, 2012
    Messages:
    30
    Likes Received:
    1
    ok I did it for you.

    Try to use this code in NGiNX configuration :

    Code:
    if (!-f $request_filename){
        set $rule_1 1$rule_1;
    }
    if (!-d $request_filename){
        set $rule_1 2$rule_1;
    }
    if ($rule_1 = "21"){
        rewrite /. /index.php last;
    }
    Please note that your site.com/wp-admin/ will not work and you will have to use site.com/wp-admin/index.php after you logged into the admin area.

    Good Luck
     
    Kingsley likes this.
  16. UFHH01

    UFHH01 Platinum Pleskian Plesk Guru

    40
    64%
    Joined:
    Jun 11, 2013
    Messages:
    4,905
    Likes Received:
    1,014
    Location:
    Hamburg / Germany
    Hi Kingsley,

    all your failures which you described here and there the last days in the forums are related in wrong or missing NGINX rewrite rules. Please just open ONE single thread of your own in the depending Parallels forum and ask for help there. You might continue searching for answers in previous threads here in the forums, but they might suit YOUR very special configuration.
     
  17. Kingsley

    Kingsley Regular Pleskian

    16
    35%
    Joined:
    Dec 13, 2014
    Messages:
    344
    Likes Received:
    9
    Location:
    Nigeria

    What i am having is high cpu, mysql , swap usage which i am yet to find any solution to
     
  18. Kingsley

    Kingsley Regular Pleskian

    16
    35%
    Joined:
    Dec 13, 2014
    Messages:
    344
    Likes Received:
    9
    Location:
    Nigeria
    alright thanks, might let it be since i am not the only one using the site
     
  19. UFHH01

    UFHH01 Platinum Pleskian Plesk Guru

    40
    64%
    Joined:
    Jun 11, 2013
    Messages:
    4,905
    Likes Received:
    1,014
    Location:
    Hamburg / Germany
    Hi Kingsley ( again ^^ ),

    as alsready written to one of your other posts, you have to investigate your very own issue, or if you would like some help with it, you have to provide the needed access- and error.logs, as well as the depending configurations files, because we can't guess your failures/issues. A note like "I'm having issues" don't point to failures and that is the reason why we can't really help you to investigate your issues/failures. Due to the case, that you seem to have issues/failures, regarding your very own system configuration, please consider to open a new thread - just for you - because it is much easier, then hopping around and trying to cope up with all your posts in the last days here in the forums. Stick to this newly created thread and try to describe your issues/failures as accurate as possible and you will see, that your issues/failures might be solved quite fast.
     
    Last edited: Dec 26, 2014
  20. Kingsley

    Kingsley Regular Pleskian

    16
    35%
    Joined:
    Dec 13, 2014
    Messages:
    344
    Likes Received:
    9
    Location:
    Nigeria
    thanks for the tips, will create another thread and provide the needed info
     
Loading...