N
N
nexus02020-06-29 07:47:33
Nginx
nexus0, 2020-06-29 07:47:33

How to process the page with a script before sending it to the client in nginx?

There is a local web server, it gives dynamic content, it cannot be touched. I am using nginx as a reverse proxy to access it. I need to modify the content before sending it by passing the page to the handler script and returning it to the client. How to do it? Yes, I know the task sounds strange, but believe me, this is how it should be. Maybe there is some article with a similar problem? Or is there something similar in the documentation? So far, I have only found a module that allows you to make a replacement using regular expressions, but this does not suit me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Pankov, 2020-06-29
@trapwalker

Write a service wrapper. This service will run locally on a different port and be routed by nginx to the desired URL. It completely proxies requests to the original local service, but processes the response before issuing it to the client. You can stir it up on some flask.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question