nginx for subfolder wordpress configuration

server {
listen      ipaddressofserver:80;
server_name xxx.xom;
root        /home/username/public_html;
index       index.php index.html index.htm;
access_log  /var/log/nginx/domains/ combined;
access_log  /var/log/nginx/domains/ bytes;
error_log   /var/log/nginx/domains/ error;

location = /favicon.ico {
log_not_found off;
access_log off;

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
location /subfolder{
try_files $uri $uri/ /subfolder/index.php?$args;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires     max;

location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return  404;

fastcgi_index   index.php;
include         /etc/nginx/fastcgi_params;

error_page  403 /error/404.html;
error_page  404 /error/404.html;
error_page  500 502 503 504 /error/50x.html;

location /error/ {
alias   /home/username/;

location ~* “/\.(htaccess|htpasswd)$” {
deny    all;
return  404;

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

include     /home/username/conf/web/nginx.domain.conf*;

Install vesta control panel with nginx php5-fpm mysql

Now execute the command below to download Vestacp installation file:
1.curl -O

2. run below command

bash –nginx yes –phpfpm yes –apache no –vsftpd yes –proftpd no –exim no –dovecot no –spamassassin no –clamav no –named yes –iptables yes –fail2ban yes –mysql yes –postgresql no –remi yes –quota no



Configure mysql

sudo apt-get install mysql-server php5-mysql

sudo /usr/bin/mysql_secure_installation

change root passsword: n
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y