|Apache Reverse Proxy , URL Error|
apache mod_proxy mod_html
I have some error with my apache reverse proxy. Currently I am doing reverse proxy to 4 websites.
I am having no problem when reverse proxy to a and b website. Image are good and no problem.
However, when comes to c and d website. Image are not getting loaded.In my access_log , here are the logs.
- - [08/May/2014:10:40:36 +0800] "GET /whatshot_v3/images/promo/img_samplePromo.jpg HTTP/1.1" 404 1245
- - [08/May/2014:10:40:36 +0800] "GET /images_v3/menu/faq_butt_03.png HTTP/1.1" 404 1245
- - [08/May/2014:10:40:36 +0800] "GET /images_v3/banner/text_planprice.gif HTTP/1.1" 404 1245
- - [08/May/2014:10:40:36 +0800] "GET /images_v3/banner/text_services.gif HTTP/1.1" 404 1245
- - [08/May/2014:10:40:36 +0800] "GET /images_v3/banner/text_account.gif HTTP/1.1" 404 1245
- - [08/May/2014:10:40:36 +0800] "GET /images_v3/shortcut/bann_store.gif HTTP/1.1" 404 1245
- - [08/May/2014:10:40:36 +0800] "GET /images_v3/shortcut/bann_rewards.gif HTTP/1.1" 404 1245
- - [08/May/2014:10:40:36 +0800] "GET /images_v3/shortcut/bann_idd.gif HTTP/1.1" 404 1245
- - [08/May/2014:10:40:36 +0800] "GET /images_v3/footer/img_customerService.png HTTP/1.1" 404 1245
- - [08/May/2014:10:40:36 +0800] "GET /images_v3/footer/icon_fb.png HTTP/1.1" 404 1245
- - [08/May/2014:10:40:36 +0800] "GET /images_v3/footer/icon_tw.png HTTP/1.1" 404 1245
- - [08/May/2014:10:40:36 +0800] "GET /images_v3/footer/icon_rss.png HTTP/1.1" 404 1245
- - [08/May/2014:10:40:36 +0800] "GET /images_v3/footer/icon_share.png HTTP/1.1" 404 1245
Accessing from the apache reverse proxy server itself have no problem. When accessing from outside, the problem occur.
I have try directly typing the url in another machine and the image are loaded.
188.8.131.52 - - [08/May/2014:10:19:00 +0800] "GET **/d/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
184.108.40.206 - - [08/May/2014:10:18:24 +0800] "GET **/images_v3/footer/icon_share.png HTTP/1.1" 404 1245** "htt://220.127.116.11/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"
As you can see the link in the first one is working. The one in the second one is not.
When I request the webpage normally, it will request the second link and it will cause 404 error as cannot find the path.
If i type directly the first link , the image was found.
I notice that c and d website are redirected when type the link.And this is the cause of the problem.
18.104.22.168/c --> 22.214.171.124/c/index_other.html
126.96.36.199/d --> 188.8.131.52/d/landing.do
Here is my apache reverse proxy configuration
CustomLog logs/arp_access_log common
So , how do i solve this? I have been researching mod_rewrite and mod_proxy_html , but no luck in solving the problem.
[edited by: phranque at 4:27 am (utc) on May 14, 2014]
[edit reason] unlinked urls in code [/edit]
Wait. Are you using the numerical IP as the actual hostname? Or did you change that for posting purposes? (You can use multiple names in Forums as needed: example.com, example.org, example.net, example.xyz...) Do the quoted logs combine all four hostnames into a single file, or are those the logs for just one of your four?
This is your own server, right? What comes up if you run a RewriteLog set to a fairly high logging level?
welcome to WebmasterWorld, ku1918!
if you check your web server error log files it should tell you what path it's looking for and not finding which may help you find the problem.
regarding index_other.html you might want to use RewriteCond and RewriteRule with the [P] flag to make this work.
regarding landing.do i would look for additional server directives perhaps on the proxy server.
There are no error in my web server log. The only log is the log that I have posted in my post which is from the access_log. All the logs are the combine logs in a single file.
How i would like to use RewriteCond and RewriteRule.I still inexperience with mod_rewrite.
One thing i know how to solve the problem is to add the /d/ path in front of GET /images_v3/footer/icon_share.png HTTP/1.1" 404 1245
Looking for advice here.
|There are no error in my web server log. |
You may need to increase the logging level. Error logs can be made to show pretty much anything in the 4xx/5xx class; the default setting is near the middle of the range. The terminology is a little misleading, because the directive
refers to error logs, not to the ordinary access logs. You probably don't need "debug", but if the server hasn't gone live yet, it won't do any real harm.
RewriteLogs are a little tricky. But unlike error logs, levels are identified by number, so you don't have to figure out whether "notice" comes before or after "info". (Really. They expect anyone to remember this stuff?)
How much experience did you have with Apache before you started running your own server? Some things can only be done in the config file, but most aspects of mod_rewrite can be learned even if you're limited to htaccess in shared hosting. It sounds as if you're learning everything at once :(
|One thing i know how to solve the problem is to add the /d/ path in front of GET |
Yes, that's your clue that something is misbehaving, because it shouldn't be necessary-- and obviously won't be possible once you're in production. You can't go around redirecting every single request just because you and the server speak different languages.
What have you got going with mod_alias? Your original question was about proxies, but it seems as if there ought to be some aliasing involved too.
I only have around 3-4 months of Apache experience. You are right as I am trying to learn everything at once.
Yes.It is about Reverse proxying.
I have not gone through with mod_alias.I will look into it.