# Emulate SSI 'exec cmd' with nginx

**URL:** <https://www.ruby-forum.com/t/emulate-ssi-exec-cmd-with-nginx/228452>\
**Category:** NGINX\
**Created:** [April 23, 2013, 12:46am UTC](https://www.ruby-forum.com/t/emulate-ssi-exec-cmd-with-nginx/228452 "2013-04-23T00:46:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lpr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9dc877/32.png) [@lpr](https://www.ruby-forum.com/u/lpr)\
**Post date:** [April 23, 2013, 12:46am UTC](https://www.ruby-forum.com/t/emulate-ssi-exec-cmd-with-nginx/228452/1 "2013-04-23T00:46:36Z")

</div>

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:

> **[Emulate SSI 'exec cmd' with nginx](https://forum.nginx.org/read.php?2,238561,238561#msg-238561)**
>
> 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'...

---

<div class="post-metadata">

**Author:** ![lpr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9dc877/32.png) [@lpr](https://www.ruby-forum.com/u/lpr)\
**Post date:** [April 23, 2013, 4:23pm UTC](https://www.ruby-forum.com/t/emulate-ssi-exec-cmd-with-nginx/228452/2 "2013-04-23T16:23:42Z")

</div>

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.

> **[nginx: donation](http://nginx.org/en/donation.html)**

---

<div class="post-metadata">

**Author:** ![lpr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9dc877/32.png) [@lpr](https://www.ruby-forum.com/u/lpr)\
**Post date:** [April 30, 2013, 2:04pm UTC](https://www.ruby-forum.com/t/emulate-ssi-exec-cmd-with-nginx/228452/3 "2013-04-30T14:04:04Z")

</div>

Thank you!

This solved my problem.

Best regards  
Lukas

Posted at Nginx Forum:

> **[Re: Emulate SSI 'exec cmd' with nginx](https://forum.nginx.org/read.php?2,238561,238739#msg-238739)**
>
> 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'...
