Nginx 500(内部服务器)错误
问题描述:
我一直有一些问题,我的NginX安装。我没有收到任何错误,但是,当我尝试访问我的本地主机地址时,出现了经典的“500 - 内部服务器错误”。Nginx 500(内部服务器)错误
这是我的配置:
user nobody; ## Default: nobody
worker_processes 5; ## Default: 1
error_log logs/error.log;
pid logs/nginx.pid;
worker_rlimit_nofile 8192;
events {
worker_connections 4096; ## Default: 1024
}
http {
include mime.types;
include fastcgi.conf;
index index index.html index.htm index.php;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/access.log main;
sendfile on;
tcp_nopush on;
server_names_hash_bucket_size 128; # this seems to be required for some vhosts
server { # simple reverse-proxy
listen 80;
access_log logs/access.log main;
# serve static files
location ~ ^/(images|javascript|js|css|flash|media|static)/ {
root /Library/Testing/public_html;
expires 30d;
}
# pass requests for dynamic content to rails/turbogears/zope, et al
location/{
proxy_pass http://127.0.0.1:8080;
}
}
upstream big_server_com {
server 127.0.0.3:8000 weight=5;
server 127.0.0.3:8001 weight=5;
server 192.168.0.1:8000;
server 192.168.0.1:8001;
}
server { # simple load balancing
listen 80;
server_name big.server.com;
access_log logs/big.server.access.log main;
location/{
proxy_pass http://big_server_com;
}
}
}
有什么问题?我查看了其他相关的SOF问题,但没有一个解决了我的问题。谢谢。
编辑:我的日志现在又说:2015/07/26 13:43:40 [error] 2494#0: *1 kevent() reported that connect() failed (61: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /index.php HTTP/1.1", upstream: "http://127.0.0.1:8080/index.php", host: "localhost"
当我尝试加载该页面“本地主机/ index.php文件”
你确定PHP没有抛出错误吗? nginx错误日志中的任何东西? – Will
@Will - 如何检查PHP错误日志? nginx似乎没有说任何有用的东西。 – ColonelHedgehog
运行'php --info | grep错误'。寻找'error_log'和'log_errors'。确保在php.ini中启用了“log_errors”,并在'error_log'中指定了一个日志文件的路径。 – Will