Awesome q2a theme

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

0 like 0 dislike
70 views
Hello.

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
by
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 nginx.org/en/docs/http/ngx_http_sub_module.html and nginx.org/en/docs/http/ngx_http_addition_module.html if not enough, then dig to the side nginx.org/en/docs/http/ngx_http_perl_module.html
by
0 like 0 dislike
habrahabr.ru/post/158393 here about it wrote.
There was a proxy_pass to another server, you just have in your =)
by
110,608 questions
257,187 answers
0 comments
40,796 users