Emulate SSI 'exec cmd' with nginx

Dear all

Trying to move my pages from Apache to nginx (1.2.1 on Debian stable
with
backports), I run into the problem of having used SSI’s ‘exec cmd’ for
more
than a decade quite intensively.

What is the best and easiest way to emulate ‘exec cmd’ with nginx?

For example, in my footers I make use of dynamically change between
ENglish
and GErman with a shell script as easy as

with setlanguage.sh as

echo “<a href="$(echo $REQUEST_URI | sed -e
‘s:/EN/:/GE/:’)">Deutsch”

When I try using , the script
is
executed. However, instead of just adding the link, nginx includes the
German web-page fully.

Is there an easy way to get the same functionality with nginx?

Thanks for any hint.

Best regards
Lukas

Posted at Nginx Forum:

Hello!

On Mon, Apr 22, 2013 at 06:45:55PM -0400, lpr wrote:

Is there an easy way to get the same functionality with nginx?
There is no “exec” SSI command support in nginx.

In this particular case I would recommend using if with regular
expression and echo commands instead. Something like this should
work:

<a href=“/GE/”>Deutsch

(Untested.)


Maxim D.
http://nginx.org/en/donation.html

Thank you!

This solved my problem.

Best regards
Lukas

Posted at Nginx Forum: