Created
April 19, 2013 08:45
-
-
Save paulbellamy/5419012 to your computer and use it in GitHub Desktop.
Trying to figure out how to do SSI includes on nginx. The first example renders 503 errors (from Haproxy) into the page, while the second example ignores ssi include statements present in ```/dynamic_partials/header```.
This file contains hidden or 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
<!--# include virtual="/dynamic_partials/header" set="header" wait="yes" --> | |
<!--# if expr="$header" --> | |
<!--# echo var="header" encoding="none" --> | |
<!--# else --> | |
{% include logged_out_header.html %} | |
<!--# endif --> |
This file contains hidden or 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
<!--# block name="logged_out_header" --> | |
{% include logged_out_header.html %} | |
<!--# endblock --> | |
<!--# include virtual="/dynamic_partials/header" stub="logged_out_header" --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Turns out that the
stub
method ignores the returned status code, and only considers an empty body as a failure, while theset
method also considers the status code, as expected. Theset
method still doesn't recursively process ssi, though.