Skip to content

Instantly share code, notes, and snippets.

@ysinc88
Last active April 28, 2016 14:54
Show Gist options
  • Save ysinc88/d2b71574d84992f9b76e2d4ed7ed8684 to your computer and use it in GitHub Desktop.
Save ysinc88/d2b71574d84992f9b76e2d4ed7ed8684 to your computer and use it in GitHub Desktop.
Rails+Nginx+Unicorn
[crit] 12429#0: *27 stat() "/home/user/soWed/public/" failed (13: Permission denied), client: 215.21.75.35, server: mamamia.xyz, request: "GET / HTTP/1.1", host: "mamamia.xyz"
#includede via nginx.conf
# ...
# include /etc/nginx/conf.d/*.conf;
#...
upstream app {
# Path to Unicorn SOCK file, as defined previously
server unix:/tmp/unicorn.soWed.sock fail_timeout=0;
}
server {
listen 80;
server_name mamamia.xyz;
# Application root, as defined previously
root /home/user/soWed/public;
try_files $uri/index.html $uri @app;
location @app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}
working_directory "/home/user/soWed"
pid "/home/user/soWed/tmp/pids/unicorn.pid"
stderr_path "/home/user/soWed/log/unicorn.log"
stdout_path "/home/user/soWed/log/unicorn.log"
# Unicorn socket
#listen "/tmp/unicorn.[soWed].sock"
listen "/tmp/unicorn.soWed.sock"
# Number of processes
# worker_processes 4
worker_processes 2
# Time-out
timeout 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment