Created
February 12, 2012 03:18
-
-
Save daqing/1806018 to your computer and use it in GitHub Desktop.
Nginx + Rabel 默认配置文件
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
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
配置Thin: