Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm having trouble getting SSI to work on NGINX. You can see the problem if you hit http://www.bakerycamp.com/test.shtml. Here is the contents of that file:

<!--# echo hi -->

If you hit this in a browser, you see the SSI directive in the content - so apparently NGINX is not interpreting the SSI directive.

My NGINX config file looks like this:

server {
    listen  80;
    server_name     bakerycamp.com www.bakerycamp.com;
    access_log      /var/log/nginx/bakerycamp.access.log;
    index           index.html;
    root            /home/bakerycamp.com;
    location /      { ssi   on; }

    # Deny access to all hidden files and folders
    location ~ /\.  { access_log off; log_not_found off; deny all; }
}

I did not build NGINX from sources but installed it using apt-get. I assume it has the SSI module (since that is default) but perhaps not? Should I just bite the bullet and rebuild from sources? Is there anyway to tell if the installed NGINX supports SSI and my config is just wrong?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

In nginx, the SSI directive echo is used to echo the contents of variables, not arbitrary text.

To test SSI, try something like:

<!--# set var="test" value="Hello nginx!" -->
<!--# echo var="test" -->

See the documentation for further details.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.