M
M
Mikhail Frolov2021-08-22 19:57:45
Nginx
Mikhail Frolov, 2021-08-22 19:57:45

How to pass result from application server (flask) to proxy_pass nginx?

In general, there is an nginx config:

location /proxy/ {
proxy_pass % result of the function execution in Flask%
}

Flask:
@app.route('/proxy/')
def proxy(): #processing
something
return ' https://yandex. en '

Is it possible to do this? Already googled it, didn't find anything. I know that the built-in nginx variables can be substituted, but it is necessary to get this value from the application server.
Thank you experts in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2021-08-22
@neuralink7232050

At the web server level, two data sources are processed - HTTP headers and the request body in the case of POST.
Tell us in more detail what you want to do, because it seems that something is strange.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question