javascript - Serve stylesheet from Rails asset pipeline on nginx error 495 (bad client certificate)? -
i have basic rails application layout, with
<%= stylesheet_link_tag 'application', media: 'all' %> <%= javascript_include_tag 'application' %>
using nginx, i'm asking optional client certificate:
ssl on; ssl_verify_client optional;
when client connects bad certificate (expired, not yet valid, or not trusted, example) nginx responds weakly generic page reading, "the ssl certificate error".
to provide reasonable user experience, tell nginx:
error_page 495 /actual_useful_information.html;
but lose stylesheets , javascripts, when browser loads page , follows links of rails layout, certificate still bad , stylesheets not forthcoming.
is there solution serve styled page making use of layout? there way inline assets pipeline (for 1 case)?
having javascript in there nice too, @ least, how styles.
i found own answer:
<% if @inline_assets %> <script><%== file.read("public#{javascript_path('application')}") %></script> <style><%== file.read("public#{stylesheet_path('application')}") %></style> <% else %> <%= stylesheet_link_tag 'application', media: 'all' %> <%= javascript_include_tag 'application' %> <% end %>
Comments
Post a Comment