Welcome! Log In Create A New Profile

Advanced

How to troubleshoot consistent http error 500

Posted by seron 
How to troubleshoot consistent http error 500
September 07, 2012 04:40AM
I'm pretty new to nginx and have it set up locally on my computer. When I go to a certain page which is part of a plugin to Wordpress I consistently get an 'error 500 Internal Server Error'. I suspect it's a problem with my setup but am too ignorant to understand it. Are there any troubleshooting/debugging procedures for nginx that I could use?

Below are logs and configuration. Something that caught my interest is the reference to server: ~^local\.(?<site>.+)\.dev$ in the error.log. This is a regex in nginx.conf for the server_name. I didn't expect it to appear in the regex form outside the config file, but in its parsed form local.site.dev. Could this be the culprit?

The nginx error.log:
2012/09/06 17:38:40 [info] 20493#0: *151 kevent() reported that client prematurely closed connection, so upstream connection is closed too while sending request to upstream, client: 127.0.0.1, server: ~^local\.(?<site>.+)\.dev$, request: "POST /wp-cron.php?doing_wp_cron=1346945920.0074169635772705078125 HTTP/1.0", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "local.site.dev"
2012/09/06 17:40:47 [info] 20493#0: *179 client prematurely closed connection while reading client request line, client: 127.0.0.1, server: ~^local\.(?<site>.+)\.dev$

note: most of the time there's nothing added to the error.log when the 500 error occurs.

The access.log:
127.0.0.1 - - [07/Sep/2012:10:01:22 +0200] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 604 "http://local.site.dev/wp-admin/admin.php?page=duplicator.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:15.0) Gecko/20100101 Firefox/15.0.1" "1.58"
127.0.0.1 - - [07/Sep/2012:10:01:24 +0200] "GET /wp-content/plugins/duplicator/css/images/ui-bg_glass_65_ffffff_1x400.png HTTP/1.1" 200 320 "http://local.site.dev/wp-content/plugins/duplicator/css/jquery-ui.css?ver=1.8.21" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:15.0) Gecko/20100101 Firefox/15.0.1" "-"
127.0.0.1 - - [07/Sep/2012:10:01:24 +0200] "POST /wp-admin/admin-ajax.php HTTP/1.1" 500 529 "http://local.site.dev/wp-admin/admin.php?page=duplicator.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:15.0) Gecko/20100101 Firefox/15.0.1" "-"

My nginx.conf:

user nobody;
worker_processes 2;

error_log var/log/nginx/error.log debug;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

log_format main
'$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';

sendfile on;
tcp_nopush on;
# keepalive_timeout 65;
gzip on;
ignore_invalid_headers on;

index index.php index.html index.htm;

server {
listen 80;
server_name ~^local\.(?<site>.+)\.dev$;
root /Users/ivan/Sites/$site;
access_log var/log/nginx/access.log main;

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

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}

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

location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
}
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 198
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready