Created
June 15, 2011 21:31
-
-
Save lucasrenan/1028174 to your computer and use it in GitHub Desktop.
Configs nginx webbynode
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
#apps na webbynode | |
cd /opt/nginx/phd-sites | |
#expires header (js, css) | |
server { | |
listen 80; | |
server_name site.com ; | |
root /var/rapp/site/public; | |
passenger_enabled on; | |
location ~* ^.+\.(css|js)$ { | |
access_log off; | |
expires max; | |
} | |
} | |
#gzip (js, css…) | |
#gzip tem que estar como on | |
sudo vi /opt/nginx/conf/nginx.conf | |
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; | |
#setar no painel da webbynode e depois | |
sudo vi /opt/nginx/phd-sites/site.com | |
server { | |
listen 80; | |
server_name site.webbyapp.com asset1.site.webbyapp.com; | |
root /var/rapp/site/public; | |
passenger_enabled on; | |
} | |
#app rails - production.rb | |
config.action_controller.asset_host = Proc.new do |source, request | |
domain = "site.webbyapp.com" | |
if source.starts_with?('/media') | |
#"http://img#{rand(2) + 1}.#{domain}" | |
"http://img2.#{domain}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment