E
E
ekim2015-01-18 15:51:32
Nginx
ekim, 2015-01-18 15:51:32

Music proxying through nginx?

there is a php site on
it you can play music through the Contact
player accesses the file /mp3.php?url=link_to_file_from_vk.mp3 (where fopen, fread happens)
it turns out that Apache heavily loads the server.
what needs to be written in the nginx config to make proxying through nginx.
ps direct links will not work, tk. VK generates mp3 links taking into account the ip-server.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2015-01-18
Protko @Fesor

(where fopen, fread happens)

php.net/manual/en/function.readfile.php - pay special attention to the notes.

S
Sergey Savostin, 2015-01-18
@savostin

location /mp3.php {
rewrite .+ $arg_uri break;
proxy_pass $arg_server;
}

Just need to convert the link to
/mp3.php?uri=/path/to/mp3&server=http://downoad.vk.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question