Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a way to modify the body of a response created by some webserver to which I proxy my requests using Nginx:

server {
    listen   80;
    server_name localhost;

    location /myproject/ {
        > modify response from before sending

It's something like HttpSubModule but with an external program rather than simple text replacement. The modifying program is a Node.js webserver, so I thought about sending the response in a post request. But that's just a brief idea, every kind of approach is highly appreciated.

share|improve this question

I've always liked nginx's XSLT processor for jobs like those. Wrote a lengthy blog post on that last year, too - shameless plug: -- scroll down a bit to the XSLT part.

nginx's XSLT processor will also let you use data from other sources with the document function.

share|improve this answer
A very promising approach. Thanks for the article. I'll have a closer look before accepting this as answer. – Sebastian vom Meer Jan 16 '13 at 10:11
Well, sadly it requires a bit of a knack for XSLT 1.0, which tends to scare people off, but it did seem relevant to your problem. Worst case it'll give you a new angle ;). – Magnus Jan 16 '13 at 10:14

Your Answer


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.