H
H
Hazrat Hajikerimov2019-03-10 01:10:13
Nginx
Hazrat Hajikerimov, 2019-03-10 01:10:13

Does the speed of the application slow down significantly when using proxy_pass?

Greetings, there is a certain site and it broadcasts a video, I would like to push it into an iframe and display it on my site, but there is a problem! it is without https and when added to an iframe it displays something completely different) apparently looks at the header Host.
So I stuffed it into proxy_pass like this:

location /stream {
                proxy_pass http://******.stream/stream.php;
                proxy_set_header Host *******.stream;
                proxy_set_header Referer http://******.**;
                proxy_set_header Upgrade-Insecure-Requests 1;
                proxy_set_header Accept-Encoding "";
                sub_filter '<body>' '<body style="margin: 0">';
                sub_filter_once off;
        }

everything is working! but there is one thing, the speed of the broadcast has greatly decreased, below the graphics:
image.pngimage.png
In the first version of the original, the download speed of the stream is on average 200-400 ms, and with proxy_pass 1-30 seconds
How can I optimize the work of proxy_pass, is there any other solution? faster?
and yes, the hardware is fast enough 8 core, 16gb, 100ssd on hetzner
can there be a way to optimize the speed of nginx?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Danil Sapegin, 2019-03-10
@ynblpb_spb

First, check the channel and download speed from the server in hetzner to the server http://******.stream/stream.php;
There are suspicions that the problem is not in the proxy_pass, but in the channel

V
Viktor Taran, 2019-03-11
@shambler81

1 sub_filter - maybe this is a problem
2. ping from this server before and not from your computer
3. if you have Apache, try http proxy, maybe there will be different, at least the statistics will be there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question