Welcome! Log In Create A New Profile

Advanced

502 Bad Gateway- Nginx and thin

Yunior Miguel A.
March 18, 2013 11:14AM
I have install nginx 1.1.19 and thin 1.5.0 in Ubuntu 12.04 and I am
install redmine, when I try to access the page of redmine gives me the
following error: 502 Bad Gateway. In Nginx log reads:
2013/03/18 10:45:09 [crit] 13886#0: *11 connect() to
unix:/tmp/thin.0.sock failed (2: No such file or directory) while
connecting to upstream, client: 127.0.0.1, server:
redmine_nginx.ipp.com, request: "GET / HTTP/1.1", upstream:
"http://unix:/tmp/thin.0.sock:/", host: "redmine_nginx.ipp.com"
thin configuration:

chdir: /var/www/redmine_nginx/
environment: production
address: 0.0.0.0
port: 3000
timeout: 30
log: /var/log/thin/redmine.log
#pid: /var/run/thin/redmine.pid
pid: tmp/pids/thin.pid
max_conns: 1024
max_persistent_conns: 512
require: []
wait: 30
servers: 1
daemonize: true
socket: /tmp/thin.sock
group: www-data
user: www-data

Nginx Service block:
upstream thin_cluster {
server unix:/tmp/thin.0.sock;

}

server {

listen 80; ## listen for ipv4

# Set appropriately for virtual hosting and to use
server_name_in_redirect
server_name redmine_nginx.ipp.com;
server_name_in_redirect off;

access_log /var/log/nginx/localhost.access.log;
error_log /var/log/nginx/localhost.error.log;

# Note: Documentation says proxy_set_header should work in location
# block, but testing did not support this statement so it has
# been placed here in server block
include /etc/nginx/proxy_opts;
proxy_redirect off;

# Note: Must match the prefix used in Thin configuration for Redmine
# or / if no prefix configured
location / {
root /var/www/redmine_nginx/public;

error_page 404 404.html;
error_page 500 502 503 504 500.html;
try_files $uri/index.html $uri.html $uri @redmine_thin_servers;
}

location @redmine_thin_servers {
proxy_pass http://thin_cluster;
}
}

the include /etc/nginx/proxy_opts;

# Shared options used by all proxies
proxy_set_header Host $http_host;

# Following headers are not used by Redmine but may be useful for
plugins and
# other web applications
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

# Any other options for all proxies here
client_max_body_size 10m;
client_body_buffer_size 128k;

proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;

proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;

--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

502 Bad Gateway- Nginx and thin

Yunior Miguel A. March 18, 2013 11:14AM

Re: 502 Bad Gateway- Nginx and thin

Maxim Dounin March 18, 2013 11:24AM

Re: 502 Bad Gateway- Nginx and thin

Francis Daly March 18, 2013 11:28AM

Re: 502 Bad Gateway- Nginx and thin

Yunior Miguel A. March 18, 2013 12:14PM

Re: 502 Bad Gateway- Nginx and thin

Francis Daly March 18, 2013 01:16PM

Re: 502 Bad Gateway- Nginx and thin

Yunior Miguel A. March 18, 2013 03:54PM

Re: 502 Bad Gateway- Nginx and thin

basti March 18, 2013 04:12PM

Re: 502 Bad Gateway- Nginx and thin

Francis Daly March 18, 2013 04:26PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 270
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