Author |
|
ku1918
Joined: 06 May 2014 Posts: 7 Location: Malaysia
|
Posted: Tue 06 May '14 10:05 Post subject: Apache Reverse Proxy - Multimedia File Not Displaying |
|
|
Hi all,
I am trying to do reverse proxy for several web servers in my network.I have successfully configure the reverse proxy.However , when website with multimedia webpages are requested , the multimedia content is not displaying.What is the problem? What is is that I am missing in my config file.
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
#DocumentRoot /www/docs/dummy-host.example.com
ServerName dummy-host.example.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
ProxyRequests Off
ProxyPass /a http://a.com
ProxyPass /b http://192.168.1.4/b
ProxyPass /c http://192.168.1.5/c
ProxyPass /xxx http://x.x.x.x:8080/
ProxyPassReverse http://a.com /a
ProxyPassReverse http://192.168.1.4/b /b
ProxyPassReverse http://192.168.1.5/c /c
ProxyPassReverse http://x.x.x.x:8080 /xxx
</VirtualHost> |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 06 May '14 10:46 Post subject: |
|
|
The ProxyPassReverse configs are the wrong way arround. Change the local and the remote path. |
|
Back to top |
|
ku1918
Joined: 06 May 2014 Posts: 7 Location: Malaysia
|
Posted: Tue 06 May '14 10:57 Post subject: |
|
|
I reverse it already. Still the same problem. Multimedia (images) are not displaying. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 06 May '14 11:19 Post subject: |
|
|
What is in your error log and or access log about it? |
|
Back to top |
|
admin Site Admin
Joined: 15 Oct 2005 Posts: 692
|
|
Back to top |
|
jraute
Joined: 13 Sep 2013 Posts: 188 Location: Rheinland, Germany
|
Posted: Tue 06 May '14 11:52 Post subject: |
|
|
Hello ku1918
may i make a suggestion?
i would try to separate the different sites via location entries.
Code: |
<VirtualHost *:80>
...
<Location /a>
ProxyPreserveHost Off
ProxyPass http://192.168.1.4/a
ProxyPassReverse http://192.168.1.4/a
</Location>
<Location /b>
ProxyPreserveHost Off
ProxyPass http://192.168.1.5/b
ProxyPassReverse http://192.168.1.5/b
</Location>
</VirtualHost>
|
Then i would try to check why the multimedia content is not going through.
Do you use a .htaccess file in combination with mime.types? Maybe there are special entries, which cause problems ... |
|
Back to top |
|
ku1918
Joined: 06 May 2014 Posts: 7 Location: Malaysia
|
Posted: Wed 07 May '14 8:17 Post subject: |
|
|
- [07/May/2014:14:16:27 +0800] "GET /js/cufon-myPro_regular.js HTTP/1.1" 404 1245
- - [07/May/2014:14:16:27 +0800] "GET /js/cufon-aller_regular.js HTTP/1.1" 404 1245
- - [07/May/2014:14:16:27 +0800] "GET /js/cufon-lSans_regular.js HTTP/1.1" 404 1245
- [07/May/2014:14:16:27 +0800] "GET /js/jquery.easing.1.3.js HTTP/1.1" 404 1245
- - [07/May/2014:14:16:27 +0800] "GET /js/jquery.scrollTo-min.js HTTP/1.1" 404 1245
- - [07/May/2014:14:16:27 +0800] "GET /js/jquery.corner.js HTTP/1.1" 404 1245
- - [07/May/2014:14:16:27 +0800] "GET /js/dragdealer.js HTTP/1.1" 404 1245
- - [07/May/2014:14:16:27 +0800] "GET /js/init.js HTTP/1.1" 404 1245
i get this kind of log in my access_log.404 means unable to get the content right?
- - [07/May/2014:14:16:27 +0800] "GET /js/form.js HTTP/1.1" 404 1245 - - [07/May/2014:14:16:28 +0800] "GET /images/aboutus/aboutus_titleSub.png HTTP/1.1" 404 1245 |
|
Back to top |
|
jraute
Joined: 13 Sep 2013 Posts: 188 Location: Rheinland, Germany
|
Posted: Wed 07 May '14 9:21 Post subject: |
|
|
Have you tried separating the entries into locations?
Try that first! |
|
Back to top |
|
ku1918
Joined: 06 May 2014 Posts: 7 Location: Malaysia
|
Posted: Wed 07 May '14 9:47 Post subject: |
|
|
Already separate the locations. |
|
Back to top |
|
jraute
Joined: 13 Sep 2013 Posts: 188 Location: Rheinland, Germany
|
Posted: Wed 07 May '14 11:02 Post subject: |
|
|
Did you try to open a browser on the computer running the apache and to connect to the backend server? Did you get the content? If thats working the reverse proxy is really the problem - otherwise the problem is somewhere else. |
|
Back to top |
|
ku1918
Joined: 06 May 2014 Posts: 7 Location: Malaysia
|
Posted: Wed 07 May '14 11:09 Post subject: |
|
|
Yes. it is working on the server that have the apache httpd running on it.
When accessing from another computer , only the image link are broken.
I have 4 website running. 2 of them images has no problem.
2 of it having problem because i notice the webpages are redirecting.
For an example ,
www.abc.com --> www.abc.com/bcd.html
So , what i can do to fix the error. I have read about mod_rewrite and mod_proxy_html , am still try to solving it. |
|
Back to top |
|
jraute
Joined: 13 Sep 2013 Posts: 188 Location: Rheinland, Germany
|
Posted: Wed 07 May '14 11:18 Post subject: |
|
|
mod_proxy_html would be the right one. |
|
Back to top |
|
ku1918
Joined: 06 May 2014 Posts: 7 Location: Malaysia
|
Posted: Wed 07 May '14 11:32 Post subject: |
|
|
Can give me an example? |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
|
Back to top |
|
ku1918
Joined: 06 May 2014 Posts: 7 Location: Malaysia
|
Posted: Thu 08 May '14 4:22 Post subject: |
|
|
Hi,
1.1.1.1 - - [08/May/2014:10:19:00 +0800] "GET /digi/images_v3/footer/icon_share.png HTTP/1.1" 200 869 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36
1.1.1.1 - - [08/May/2014:10:18:24 +0800] "GET /images_v3/footer/icon_share.png HTTP/1.1" 404 1245 "http://192.168.117.110/digi/landing.do" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36"
Hi , as you can see the link that is highlight in red is working. The one is highlight in blue is not working.
When i request the webpage normally , it will request the blue link and it will cause 404 error as cannot find the path.
If i type directly the red link , the image was found.
So , how do i solve this? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 26 May '14 10:17 Post subject: |
|
|
As Steffen pointed out you should use mod_proxy_html.
Another solution would be to use some Alias, but that is a more ugly solution. |
|
Back to top |
|