Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding expiry headers to Nginx Configuration #24

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions config/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Expires map
map $sent_http_content_type $expires {
default off;
~image/ max;
}

#
# --- Stable docs --------------------------------------------------------------
#

server {
server_name api.rubyonrails.org;
gzip_static on;
expires $expires;

location ~ ^/v\d {
root /home/rails/api;
Expand Down Expand Up @@ -38,6 +45,7 @@ server {
server {
server_name guides.rubyonrails.org;
gzip_static on;
expires $expires;

rewrite /contributing_to_rails.html /contributing_to_ruby_on_rails.html permanent;
rewrite /contribute.html /contributing_to_ruby_on_rails.html permanent;
Expand Down Expand Up @@ -79,6 +87,7 @@ server {
server {
server_name edgeapi.rubyonrails.org;
gzip_static on;
expires $expires;

root /home/rails/api/edge;
index index.html;
Expand All @@ -95,6 +104,7 @@ server {
server {
server_name edgeguides.rubyonrails.org;
gzip_static on;
expires $expires;

rewrite /contributing_to_rails.html /contributing_to_ruby_on_rails.html permanent;
rewrite /contribute.html /contributing_to_ruby_on_rails.html permanent;
Expand Down