Skip to content

Instantly share code, notes, and snippets.

@daqing
Created February 12, 2012 03:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daqing/1806018 to your computer and use it in GitHub Desktop.
Save daqing/1806018 to your computer and use it in GitHub Desktop.
Nginx + Rabel 默认配置文件
upstream thin {
server 127.0.0.1:3000;
}
#server {
# listen 80;
# server_name example.com;
# rewrite ^(.*)$ http://www.example.com$1 permanent;
#}
server {
listen 80;
server_name www.example.com;
root /home/ubuntu/rabel-1.0/public;
index index.html index.htm;
location ~ ^/assets/ {
gzip_static on;
expires 1y;
add_header Cache-Control public;
add_header Last-Modified "";
add_header ETag "";
break;
}
location / {
try_files $uri @rabel;
}
location @rabel {
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://thin;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
@daqing
Copy link
Author

daqing commented Feb 12, 2012

配置Thin:

thin config -C ~/rabel.yml -s1 -e production -p 3000 -a 127.0.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment