我在Ubuntu 13.04服务器上安装了Redmine。 这个安装工作正常,我确认Redmine正在使用WEBrick服务器(根据redmine文档)。
为了让事情更稳定,我想在Nginx&薄。
有了这部分,我遇到了问题,因为Nginx报告了超时:
2013/07/19 07:47:32 [error] 1051#0: *10 upstream timed out (110: Connection timed out) while connecting to upstream, .......
精简配置:
---
chdir: /home/redmine/app/redmine
environment: production
address: 127.0.0.1
port: 3000
timeout: 5
log: log/thin.log
pid: tmp/pids/thin.pid
max_conns: 128
max_persistent_conns: 64
require: []
wait: 10
servers: 1
daemonize: true
我可以看到Thin正在运行,创建了pid文件并启动了日志文件。 我发现在执行请求时没有进一步添加日志文件。
Nginx配置:
upstream redmine {
server 127.0.0.1:3000;
}
server {
server_name redmine.my.domain;
listen 443;
ssl on;
ssl_certificate /home/redmine/sites/redmine/certificates/server.crt;
ssl_certificate_key /home/redmine/sites/redmine/certificates/server.key;
access_log /home/redmine/sites/redmine/logs/server.access.nginx.log;
error_log /home/redmine/sites/redmine/logs/server.error.nginx.log;
root /home/redmine/app/redmine;
location / {
try_files $uri @ruby;
}
location @ruby {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_read_timeout 5;
proxy_pass http://redmine;
}
}
我可以看到Nginx日志的附加内容。
任何人都可以给我一个关于在哪里找到问题的提示吗?
iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:3000
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
答案 0 :(得分:1)
错误是因为您的防火墙“iptables”阻止了该端口。
回滚iptables配置,然后发出以下命令:
iptables -I INPUT -i lo -p tcp --dport 3123 -j ACCEPT
请记住通过以下方式保存设置:
service iptables save
有关iptables的更多信息:https://help.ubuntu.com/community/IptablesHowTo
P.S。上述命令可能需要sudo
。