Skip to content

Instantly share code, notes, and snippets.

@paulbellamy
Created April 19, 2013 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulbellamy/5419012 to your computer and use it in GitHub Desktop.
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```.
<!--# include virtual="/dynamic_partials/header" set="header" wait="yes" -->
<!--# if expr="$header" -->
<!--# echo var="header" encoding="none" -->
<!--# else -->
{% include logged_out_header.html %}
<!--# endif -->
<!--# block name="logged_out_header" -->
{% include logged_out_header.html %}
<!--# endblock -->
<!--# include virtual="/dynamic_partials/header" stub="logged_out_header" -->
@paulbellamy
Copy link
Author

Turns out that the stub method ignores the returned status code, and only considers an empty body as a failure, while the set method also considers the status code, as expected. The set method still doesn't recursively process ssi, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment