This repository has been archived by the owner on Apr 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
Feature/gzip support #158
Open
ghost
wants to merge
7
commits into
intercity:master
Choose a base branch
from
unknown repository
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/gzip support #158
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
261663d
upgraded serverspec
oiuzikov ab45b41
Added assets location settings to nginx config with gzip enabled
oiuzikov 509308f
fixed houndci warnings
oiuzikov 17e44b4
New application config option: gzip_enabled
oiuzikov 39a50fd
Set sample default gzip_enabled to false
oiuzikov b91c7c6
Added context block around nginx gzip spec for better readability
oiuzikov be800ff
Extracted nginx server root path variable from template to recipe/helper
oiuzikov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
6 changes: 6 additions & 0 deletions
6
vendor/cookbooks/rails/templates/default/_app_nginx_location_assets.erb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
location ~ ^/(assets)/ { | ||
root <%= @server_root_public_path %>; | ||
gzip_static on; | ||
expires max; | ||
add_header Cache-Control public; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpicking here, but the } is not placed correctly yet ;) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, I've got some issues with rendering partials, the first line is always shifted 2 spaces right |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
<% server_root_public_path = "#{node['rails']['applications_root']}/#{@name}/current/public" %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be possible to set this from the recipe instead of in the template? Somehow this feels a little hacky |
||
|
||
<%= @custom_configuration["before_server"] %> | ||
|
||
server { | ||
listen <%= node['nginx']['port'] || '80' %>; | ||
server_name <%= @domain_names.join(' ') %>; | ||
root <%= node['rails']['applications_root'] %>/<%= @name %>/current/public; | ||
root <%= server_root_public_path %>; | ||
|
||
passenger_enabled on; | ||
passenger_app_env <%= @rails_env %>; | ||
|
||
<%= render '_app_nginx_location_assets.erb', variables: { server_root_public_path: server_root_public_path } %> | ||
|
||
<%= @custom_configuration["server_main"] %> | ||
} | ||
|
||
|
@@ -23,7 +28,10 @@ server { | |
|
||
server_name <%= @domain_names.join(' ') %>; | ||
|
||
root <%= node['rails']['applications_root'] %>/<%= @name %>/current/public; | ||
root <%= server_root_public_path %>; | ||
|
||
<%= render '_app_nginx_location_assets.erb', variables: { server_root_public_path: server_root_public_path } %> | ||
|
||
<%= @custom_configuration["ssl_main"] %> | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you but a
context
block around this? so it tells a bit more about what you're testing. So you get something like: