Last active
April 28, 2016 14:54
-
-
Save ysinc88/d2b71574d84992f9b76e2d4ed7ed8684 to your computer and use it in GitHub Desktop.
Rails+Nginx+Unicorn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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