Jump to content

using reverse proxy to access YouTube


adammw

Recommended Posts

Hi.

I am trying to create a reverse proxy to youtube, but am having problems with URL rewriting.

Does anyone know/have any rules for YouTube already?

I seem to be ok with the normal URLs (such as ones defined in <a> <img> etc. tags) but the real trouble is that many scripts refer to "http://www.youtube.com" or "/the_url_here" and this doesn't get re-written by my rules. I have tried ProxyHTMLExtended On, but this makes it worse, as it rewrites too much (e.g. the </a> tag becomes </my_url_to_the_reverse_proxy/a>.

 

My current server configuration is listed below (if it helps):

ProxyRequests Off
ProxyPass /secure-area/youtube/img-youtube/ http://img.youtube.com/
ProxyPass /secure-area/youtube/ http://www.youtube.com/
ProxyHTMLURLMap http://img.youtube.com /secure-area/youtube/img-youtube
ProxyHTMLURLMap http://www.youtube.com /secure-area/youtube
<Location /secure-area/youtube/img-youtube/>
ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /secure-area/youtube/img-youtube/
ProxyHTMLURLMap /secure-area/youtube/img-youtube /secure-area/youtube/img-youtube
RequestHeader unset Accept-Encoding
</Location>
<Location /secure-area/youtube/>
ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /secure-area/youtube/
ProxyHTMLURLMap /secure-area/youtube /secure-area/youtube
RequestHeader unset Accept-Encoding
</Location>


<Proxy *>
# I have added this to restrict my proxy to the local network, just in-case the "secure-area" isn't secure enough.
        Order Deny,Allow
Deny from all
Allow from 192.168.0
</Proxy>

Link to comment
https://forums.phpfreaks.com/topic/57957-using-reverse-proxy-to-access-youtube/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.