• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Plesk 11.5.3 , NGINX Conf problem

A.Chakery

Basic Pleskian
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 :

Invalid nginx configuration: nginx: [emerg] duplicate location "/" in /var/www/vhosts/system/domain.com/conf/vhost_nginx.conf:2 nginx: configuration file /etc/nginx/nginx.conf test failed


any help is really appreciated ...
 
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?
 
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:
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;
        }
 
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;
        }

Any help is really appreciated !!
 

Thank you very much for the reply...

it give me this error :

Invalid nginx configuration: nginx: [emerg] duplicate location "/" in /var/www/vhosts/system/aionets.com/conf/vhost_nginx.conf:2 nginx: configuration file /etc/nginx/nginx.conf test failed

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
 
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 .
 
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 .

Do you have the link or step?
 
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 .

Also which of the above code did you use
 
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
 
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.
 
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.


What i am having is high cpu, mysql , swap usage which i am yet to find any solution to
 
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

alright thanks, might let it be since i am not the only one using the site
 
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 by a moderator:
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 you issues/failures as accurate as possible and you will see, that your issues/failures might be solved quite fast.

thanks for the tips, will create another thread and provide the needed info
 
Back
Top