我的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"
当我尝试加载页面“localhost / index.php”
时答案 0 :(得分:0)
我解决了我的问题。事实证明我忘了激活php-fpm:sudo php-fpm
可以解决问题。