i’ve tried several configuration instructions and forum posts but nothing worked for me, I still get 502-bad gateway errors when I try to access my website.
$config[“index_page”] = “”;
...
$config[“uri_protocol”] = “REQUEST_URI”; // also tried AUTO
My nginx configuration:
server {
server_name dev.monitr.io;
root /home/monitr/web/dev/www/;
include /etc/sites/ci_vhost;
}
/etc/sites/ci_vhost:
index index.html index.php index.htm;
# set expiration of assets to MAX for caching
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
expires max;
log_not_found off;
}
location / {
# Check if a file exists, or route it to index.php.
try_files $uri $uri/ @rewrites;
}
location @rewrites {
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
}
location ~ \.php {
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;
fastcgi_index index.php;
}
kind regards, phillip
sudo ps ax | grep phpand check existanceof /var/run/php-fastcgi/php-fastcgi.socketapt-get install php5-mysql. If 500 apperas again set in php.ini display_erros to true and error reporting to E_ALL. You should see php error and understand the problem. If not, set in php.inierror_log = /absolute/path/to/logfileand read it. Btw, look in/var/log/php-fpm.log(or smth like this). If there is no log for php-fpm, set it in /etc/php5/php-fpm.ini (or smth like this). Good luck!