β

Ubuntu+Nginx+Thin+Rails

有梦最美,希望相随 124 阅读

nginx 配置文件

http {

......

upstream  www.suxu.info {

server 127.0.0.1:3000;

server 127.0.0.2:3001;

}

server {

listen 80;

server_name  www.suxu.info;

gzip on;

gzip_comp_level 2;

gzip_proxied any;

gzip_types  text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;


root  /root/apps/www.suxu.info/current/public/;

index index.html;

location / {

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;

if (-f $request_filename/index.html) {

rewrite (.*) $1/index.html break;

}

if (-f $request_filename.html) {

rewrite (.*) $1.html break;

}

if (!-f $request_filename) {

proxy_pass http://www.suxu.info;

break;

}

}

......

}




LOFTER:有梦最美,希望相随   http://hisuxu.lofter.com/post/9281f_de3b21
作者:有梦最美,希望相随
有梦最美,希望相随
原文地址:Ubuntu+Nginx+Thin+Rails, 感谢原作者分享。