You should read nginx error logs for details in /var/log/nginx/ and check output of:
Code:/etc/init.d/nginx -t
Probably you need to encrease server_names_hash_max_size or server_names_hash_bucket_size.
A problem i regulary have is when nginx isn't stopped correctly it won't start.
When you see
Stopping nginx:
Starting nginx: [ OK ]
You can try
service nginx status
if that one is saying running kill the pid.
kill ******
where ***** is the pid number.
Then go and type
service nginx restart
Then the following output will be generated
Stopping nginx: [ Failed ]
Starting nginx: [ OK ]
502 usually means that there is no response from Apache. Please check:
Code:ps auxw | grep httpd httpd -t
If you'd like to, I could check&fix it on your server (free of charge).
Does it mean I have to create a folder nginx_static_files and put my static files in there?
However looking at Apache's server-status Apache was still serving (all?) the images, maybe to Apache or maybe to the user, but it was serving to something.
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm)$
{
root /home/<user>/domains/<domain>/public_html/;
add_header Who Nginx;
}
Now Nginx was really sending the images itselves and Apache didn't touch it.
I've had it twice so far, both times after tinkering with nginx/apache/php-fpmHi guys,
I've ran into the 502 bad gateway error. how to fix is?
try php-fpm56