1
我想激活gzip壓縮在我的Nginx和麒麟的.gz壓縮資源文件:獲取NGINX服務與麒麟
working_directory "/home/user/project.com/current"
shared_path = '/home/user/project.com/shared'
pid "#{shared_path}/pids/unicorn.pid"
stderr_path "#{shared_path}/log/unicorn.log"
stdout_path "#{shared_path}/log/unicorn.log"
listen '/tmp/unicorn.project.sock'
worker_processes 2
timeout 30
:
我配置/ unicorn.rb有這個在我的Rails應用程序
我在Rails應用程序有這個在我nginx.conf:
upstream unicorn {
server unix:/tmp/unicorn.project.sock fail_timeout=0;
}
server {
listen 80 default;
root ~/project.com/current/public;
try_files $uri/index.html $uri @unicorn;
location @unicorn {
proxy_pass http://unicorn;
}
error_page 500 502 503 504 /500.html;
}
我怎樣才能啓用此配置某物像:
gzip_static on;
expires max;
add_header Cache-Control public;
謝謝!
謝謝它的正確性:D – hyperrjas 2012-03-22 17:18:35