nginx - open()失败(2:没有这样的文件或目录)

时间:2015-05-07 04:45:33

标签: apache nginx

我运行了这个教程:http://www.schenkels.nl/2014/12/reverse-proxy-with-odoo-8-nginx-ubuntu-14-04-lts/#comment-822 我在Debian Wheezy上做过它并且它有效。但是当我在Debian Sqeez上做同样的事情时,它不起作用。

在nginx日志中,我看到了这些错误:

2015/05/07 07:20:17 [error] 6419#0: *6 open() “/var/www/longpolling/poll” failed (2: No such file or directory), client: IP_address, server: localhost, request: “POST /longpolling/poll HTTP/1.1″

我是否需要在Squeez上做一些不同的事情(可能有一些较旧的nginx)?

网站配置如下所示:

upstream odoo8 {
server 127.0.0.1:8069 weight=1 fail_timeout=0;
}

upstream odoo8-im {
server 127.0.0.1:8072 weight=1 fail_timeout=0;
}

## http redirects to https ##
server {
listen 80;
server_name _;

# Strict Transport Security
add_header Strict-Transport-Security max-age=2592000;
rewrite ^/.*$ https://$host$request_uri? permanent;
}

server {
# server port and name
listen 443;
server_name _;

# Specifies the maximum accepted body size of a client request,
# as indicated by the request header Content-Length.
client_max_body_size 200m;

# add ssl specific settings
keepalive_timeout 60;
ssl on;
ssl_certificate /etc/ssl/nginx/server.crt;
ssl_certificate_key /etc/ssl/nginx/server.key;

# limit ciphers
ssl_ciphers HIGH:!ADH:!MD5;
ssl_protocols SSLv3 TLSv1;
ssl_prefer_server_ciphers on;

# increase proxy buffer to handle some OpenERP web requests
proxy_buffers 16 64k;
proxy_buffer_size 128k;

#general proxy settings
# force timeouts if the backend dies
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;

# set headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;

# Let the OpenERP web service know that we’re using HTTPS, otherwise
# it will generate URL using http:// and not https://
proxy_set_header X-Forwarded-Proto https;

# by default, do not forward anything
proxy_redirect off;
proxy_buffering off;

location / {
proxy_pass http://odoo8;
}

location /longpolling {
proxy_pass http://odoo8-im;
}

# cache some static data in memory for 60mins.
# under heavy load this should relieve stress on the OpenERP web interface a bit.
location /web/static/ {
proxy_cache_valid 200 60m;
proxy_buffering on;
expires 864000;
proxy_pass http://odoo8;
}
}

P.S。如果重要,Odoo位置在/opt/odoo/odoo

更新 似乎发生了一些奇怪的事情。我试图默认回到apache。但现在它也没有用。我得到同样的东西:

File does not exist: /var/www/longpolling

情况发生了。反向代理在apache上运行(之前没有这样的错误)。我安装了nginx。试图运行它,它没有运行。我以为它与apache冲突(即使在安装nginx之前我停止了apache),所以我卸载了apache。然后我注意到nginx的错误。然后我删除了nginx并安装了apache,但现在它仍然会出现同样的错误。

可能导致什么?我实际上唯一做的就是安装nginx。它能以某种方式改变这些目录吗?我现在该如何修复它?

UPDATE2 使用apache,我设法恢复它的工作方式。实际上proxy_http未启用。但是对于nginx,仍然是同样的问题。 同样在Squeez上,它只安装nginx版本0.7.6,在Wheezy上它是1.2.1。也许旧版本的工作方式不同,我需要以不同的方式调整它?

UPDATE3 从backports安装的nginx(现在是1.2.1版本)。现在它正在运行,但不是很正常。在nginx日志中,我现在收到这些消息:

2015/05/08 07:54:09 [error] 32494#0: *8 connect() failed (111: Connection refused) while connecting to upstream, client: IP address, server: _, request: "POST /longpolling/poll HTTP/1.1", upstream: "http://127.0.0.1:8072/longpolling/poll", host: "db.host.eu", referrer: "http://db.host.eu/web"

还必须删除default站点符号链接,因为有了它,它只是加载欢迎到nginx屏幕。奇怪的是,位置/的反向代理有效,但/longpolling连接被拒绝。可以是因为apache2吗?现在我没有卸载它,但是停了下来。

0 个答案:

没有答案