Created
December 10, 2012 21:23
-
-
Save xlab/4253536 to your computer and use it in GitHub Desktop.
Nginx + Thin config
This file contains hidden or 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 unix:/tmp/thin.0.sock; | |
server unix:/tmp/thin.1.sock; | |
} | |
server { | |
listen 80; | |
server_name domain.ru; | |
root /var/www/domain/public; | |
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://thin; | |
break; | |
} | |
} | |
# 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