Page 1 of 1

Nginx rule

PostPosted:14 Dec 2018 01:10
by glauciolacerda
I bought a PHP script for my site and it tells me to change a rule in nginx:
server {
     listen 80 default_server;
     server_name default;
     root /home/xxxx.com.br/public_html/playlist;

     index.html index.htm index.php;

     charset utf-8;

     location / {
         try_files $ uri $ uri / /index.php?$query_string;
     }

     location = /favicon.ico {access_log off; log_not_found off; }
     location = /robots.txt {access_log off; log_not_found off; }

     access_log off;
     error_log /var/log/nginx/default-error.log error;

     error_page 404 /index.php;

     location ~ \ .php $ {
         fastcgi_split_path_info ^ (. + \. php) (/.+) $;
         fastcgi_pass unix: /var/run/php5-fpm.sock;
         fastcgi_index index.php;
         include fastcgi_params;
     }

     location ~ /\.ht {
         deny all;
     }
}

But when I do this, even VPSSIM gives error. Is this rule harmful to my server?

Re: Nginx rule

PostPosted:14 Dec 2018 07:41
by glauciolacerda
I just installed this PHP script on my other VPS which is with CPanel and it worked normal, I really need to install this rule on nginx to work.

Re: Nginx rule

PostPosted:14 Dec 2018 18:31
by owsadmin
@glauciolacerda, you check the error.log ?
Check this error logs, if you can send me a PM with script link and i will check in my vpssim lab.

Dá uma checada nos logs de erro, se puder me manda por mp o script (link) para eu dar uma olhada e tentar ajudar.

Re: Nginx rule

PostPosted:20 Dec 2018 14:47
by nguyenoanh
Hello.

You must check the vhost of your domain
Code: Select all
/etc/nginx/conf.d/domain.com.conf
and must edit this:
Code: Select all
root /home/xxxx.com.br/public_html/playlist;