@@ -54,45 +54,42 @@ ModPagespeedNumExpensiveRewriteThreads <%= @num_expensive_rewrite_threads %>
5454ModPagespeedStatistics <%= @collect_statistics %>
5555
5656 <Location /mod_pagespeed_statistics>
57- Order allow,deny
5857 # You may insert other "Allow from" lines to add hosts you want to
5958 # allow to look at generated statistics. Another possibility is
6059 # to comment out the "Order" and "Allow" options from the config
6160 # file, to allow any client that can reach your server to examine
6261 # statistics. This might be appropriate in an experimental setup or
6362 # if the Apache server is protected by a reverse proxy that will
6463 # filter URLs in some fashion.
65- Allow from localhost
66- Allow from 127.0.0.1
67- Allow from ::1
68- <% @allow_view_stats . each do | host | -%>
69- Allow from <%= host %>
70- <% end -%>
64+ <%- if scope . function_versioncmp ( [ @apache_version , '2.4' ] ) >= 0 -%>
65+ Require ip 127.0.0.1 ::1 <%= Array ( @allow_view_stats ) . join ( " " ) %>
66+ <%- else -%>
67+ Order allow,deny
68+ Allow from 127.0.0.1 ::1 <%= Array ( @allow_view_stats ) . join ( " " ) %>
69+ <%- end -%>
7170 SetHandler mod_pagespeed_statistics
7271</ Location >
7372
7473ModPagespeedStatisticsLogging <%= @statistics_logging %>
7574< Location /pagespeed_console>
75+ <%- if scope . function_versioncmp ( [ @apache_version , '2.4' ] ) >= 0 -%>
76+ Require ip 127.0.0.1 ::1 <%= Array ( @allow_pagespeed_console ) . join ( " " ) %>
77+ <%- else -%>
7678 Order allow,deny
77- Allow from localhost
78- Allow from 127.0.0.1
79- Allow from ::1
80- <% @allow_pagespeed_console . each do |host | -%>
81- Allow from <%= host %>
82- <% end -%>
79+ Allow from 127.0.0.1 ::1 <%= Array ( @allow_pagespeed_console ) . join ( " " ) %>
80+ <%- end -%>
8381 SetHandler pagespeed_console
8482</ Location >
8583
8684ModPagespeedMessageBufferSize <%= @message_buffer_size %>
8785
8886< Location /mod_pagespeed_message>
87+ <%- if scope . function_versioncmp ( [ @apache_version , '2.4' ] ) >= 0 -%>
88+ Require ip 127.0.0.1 ::1 <%= Array ( @allow_pagespeed_message ) . join ( " " ) %>
89+ <%- else -%>
8990 Order allow,deny
90- Allow from localhost
91- Allow from 127.0.0.1
92- Allow from ::1
93- <% @allow_pagespeed_message . each do |host | -%>
94- Allow from <%= host %>
95- <% end -%>
91+ Allow from 127.0.0.1 ::1 <%= Array ( @allow_pagespeed_message ) . join ( " " ) %>
92+ <%- end -%>
9693 SetHandler mod_pagespeed_message
9794</ Location >
9895
0 commit comments