Skip to content

Instantly share code, notes, and snippets.

@defp
Last active December 31, 2015 03:29
Show Gist options
  • Save defp/7928205 to your computer and use it in GitHub Desktop.
Save defp/7928205 to your computer and use it in GitHub Desktop.
rails nginx this conf
upstream todo {
server 127.0.0.1:4000;
}
server {
listen 80 default;
server_name todo;
root /todo/public;
index index.html index.htm;
client_max_body_size 4M;
location ~ ^/(assets|uploads|avatar|favicon) {
access_log off;
expires 1y;
add_header Cache-Control public;
break;
}
location / {
try_files $uri @example_backend;
}
location @example_backend {
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;
client_max_body_size 4M;
client_body_buffer_size 128K;
proxy_pass http://todo;
}
# error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /500.html;
#location = /500.html {
# root /home/ubuntu/rabel/public;
#}
}
---
chdir: /home/deployer/app
environment: production
address: 127.0.0.1
port: 3000
timeout: 30
log: log/thin.log
pid: tmp/pids/thin.pid
max_conns: 1024
max_persistent_conns: 100
require: []
wait: 30
servers: 4
daemonize: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment