Created
January 6, 2009 16:27
-
-
Save shingara/43881 to your computer and use it in GitHub Desktop.
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 mongrel_blog_master_dev { | |
server 127.0.0.1:44500; | |
} | |
server { | |
listen 80; | |
server_name test.shingara.fr; | |
access_log /var/log/nginx/test.shingara.fr.access_log main; | |
location /log_typo { | |
alias /var/rails/blog-typo-master/shared/log; | |
autoindex on; | |
} | |
location / { | |
root /var/rails/blog-typo-master/current/public; | |
# needed to forward user's IP address to rails | |
proxy_set_header X-Real-IP $remote_addr; | |
# needed for HTTPS | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect false; | |
proxy_max_temp_file_size 0; | |
#redirect blog to Feedburner | |
if ($http_user_agent !~ FeedBurner) { | |
rewrite ^/xml/rss20/feed.xml$ http://feeds.feedburner.com/ProgDreamShiny; | |
rewrite ^/xml/rss20/comments/feed.xml$ http://feeds.feedburner.com/ProgDreamShinyComments; | |
rewrite ^/xml/atom/feed.xml$ http://feeds.feedburner.com/ProgDreamShiny; | |
rewrite ^/articles.atom$ http://feeds.feedburner.com/ProgDreamShiny; | |
rewrite ^/articles.rss$ http://feeds.feedburner.com/ProgDreamShiny; | |
} | |
# If the file exists as a static file serve it directly without | |
# running all the other rewite tests on it | |
if (-f $request_filename) { | |
expires max; | |
break; | |
} | |
if (!-f $request_filename){ | |
proxy_pass http://mongrel_blog_master_dev; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment