-
-
Notifications
You must be signed in to change notification settings - Fork 881
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
Add support for proxy_cache_path loader directives #984
Add support for proxy_cache_path loader directives #984
Conversation
e8fc6db
to
0500528
Compare
Can you add tests to this? |
5bef99b
to
d412d20
Compare
@wyardley managed to get the tests I wrote green. |
@@ -157,10 +157,10 @@ http { | |||
<% end -%> | |||
<% if @proxy_cache_path.is_a?(Hash) -%> | |||
<% @proxy_cache_path.sort_by{|k,v| k}.each do |key,value| -%> | |||
proxy_cache_path <%= key %> keys_zone=<%= value %> levels=<%= @proxy_cache_levels %> max_size=<%= @proxy_cache_max_size %> inactive=<%= @proxy_cache_inactive %><% if @proxy_use_temp_path %> use_temp_path=<%= @proxy_use_temp_path %><% end -%>; | |||
proxy_cache_path <%= key %> keys_zone=<%= value %> levels=<%= @proxy_cache_levels %> max_size=<%= @proxy_cache_max_size %> inactive=<%= @proxy_cache_inactive %><% if @proxy_use_temp_path %> use_temp_path=<%= @proxy_use_temp_path %><% end -%><% if @proxy_cache_loader_files %> loader_files=<%= @proxy_cache_loader_files %><% end -%><% if @proxy_cache_loader_sleep %> loader_sleep=<%= @proxy_cache_loader_sleep %><% end -%><% if @proxy_cache_loader_threshold %> loader_threshold=<%= @proxy_cache_loader_threshold %><% end -%>; |
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.
Maybe we can use -%>; and split this in multiple lines for readability?
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.
Nginx unfortunately doesn't allow you to work with multi-lines (except for a few directives, but the proxy_cache_path is not one of them).
So I'm afraid I can't change that.
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.
That is why I suggested -%>;
$ cat a.erb
a <% if true %>b <% end -%>
c
$ erb -T - < a.erb
a b c
<% end -%> | ||
<% elsif @proxy_cache_path -%> | ||
proxy_cache_path <%= @proxy_cache_path %> levels=<%= @proxy_cache_levels %> keys_zone=<%= @proxy_cache_keys_zone %> max_size=<%= @proxy_cache_max_size %> inactive=<%= @proxy_cache_inactive %><% if @proxy_use_temp_path %> use_temp_path=<%= @proxy_use_temp_path %><% end %>; | ||
proxy_cache_path <%= @proxy_cache_path %> levels=<%= @proxy_cache_levels %> keys_zone=<%= @proxy_cache_keys_zone %> max_size=<%= @proxy_cache_max_size %> inactive=<%= @proxy_cache_inactive %><% if @proxy_use_temp_path %> use_temp_path=<%= @proxy_use_temp_path %><% end %><% if @proxy_cache_loader_files %> loader_files=<%= @proxy_cache_loader_files %><% end -%><% if @proxy_cache_loader_sleep %> loader_sleep=<%= @proxy_cache_loader_sleep %><% end -%><% if @proxy_cache_loader_threshold %> loader_threshold=<%= @proxy_cache_loader_threshold %><% end -%>; |
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.
same
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.
Same as above comment
d412d20
to
a1e1c40
Compare
Signed-off-by: Christophe Vanlancker <christophe.vanlancker@inuits.eu>
a1e1c40
to
760a586
Compare
498bb87
to
760a586
Compare
…_cache_loader Add support for proxy_cache_path loader directives
…_cache_loader Add support for proxy_cache_path loader directives
Add support for loader_files, loader_sleep and loader_threshold for proxy_cache_path.
http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_path
Signed-off-by: Christophe Vanlancker christophe.vanlancker@inuits.eu