Awesome q2a theme

How to intercept the html generated by the web server before sending?

0 like 0 dislike

Such situation: there are 2 Linux server (one running Apache, another with nginx) with a lot of horrible code in unfamiliar languages and framwork. You need to make minor changes.
Tell me, please, hypothetically, instead of long and boring picking the innards, is it possible write a simple script (e.g. in python), which would intercept the html generated by the server, find the lines and replaced others? And is it possible to make this script universal for both servers, i.e. without prior configuration changes? And in what direction to look at?
by | 70 views

3 Answers

0 like 0 dislike
Can the proxy server to write and deliver between nginx and apache. There are 5-10 lines of code. I mean, you need a HTTP server that accepts request and sends it to apache, all that took. The response from Apache and nginx sends changes.

You can Google.
python proxy server
0 like 0 dislike
The best option is of course module for nginx, but writing a filter (in this case it is need) is not a trivial task.

Look at and if not enough, then dig to the side
0 like 0 dislike here about it wrote.
There was a proxy_pass to another server, you just have in your =)
110,608 questions
257,187 answers
40,796 users