LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-15-2016, 02:38 PM   #1
apss_evaluator
Member
 
Registered: Mar 2012
Posts: 115

Rep: Reputation: Disabled
apache proxy redirect showing missing static files


Can you please share me on how can a apache proxy automatically get the static files from a redirected page? I have an apache box (172.30.55.20) that has proxy cofigured and I'm trying to redirect on a web portal that is hosted under jboss container. The result of my /etc/httpd/conf.d/target.conf shows only the text boxes for username and password and the other static files are missing

target.conf

Code:
ProxyRequests Off
ProxyPass /pogi http://172.30.55.80:8080/pogi/namech/login.do
ProxyPassReverse /pogi http://172.30.55.80:8080/pogi/namech/login.do
error_log

Code:
[Mon Aug 15 11:42:14 2016] [error] [client 172.30.55.12] File does not exist: /var/www/html/javascript, referer: http://172.30.55.20/pogi
[Mon Aug 15 11:42:14 2016] [error] [client 172.30.55.12] File does not exist: /var/www/html/javascript, referer: http://172.30.55.20/pogi
[Mon Aug 15 11:42:15 2016] [error] [client 172.30.55.12] File does not exist: /var/www/html/javascript, referer: http://172.30.55.20/pogi
 
Old 08-16-2016, 02:24 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,526

Rep: Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503
Hi,

Your config is wrong. You should use something like:
Code:
ProxyRequests Off
ProxyPass /pogi http://172.30.55.80:8080/pogi
ProxyPassReverse /pogi http://172.30.55.80:8080/pogi
Regards
 
1 members found this post helpful.
Old 08-16-2016, 12:44 PM   #3
apss_evaluator
Member
 
Registered: Mar 2012
Posts: 115

Original Poster
Rep: Reputation: Disabled
Thanks bathory, the redirection worked.
btw is there a solution where the redirection should result to these = http://my_proxy_server/pogi/namech/login.do
 
Old 08-16-2016, 01:36 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,526

Rep: Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503
Quote:
btw is there a solution where the redirection should result to these = http://my_proxy_server/pogi/namech/login.do
You can use mod_rewrite to redirect the homepage "/" to "/pogi/namech/login.do".
Then apache will send the new rewritten URL to the backend jboss:
Code:
RewriteEngine On
RewriteRule ^/$ /pogi/namech/login.do [R=301,L]
 
1 members found this post helpful.
Old 08-17-2016, 03:13 PM   #5
apss_evaluator
Member
 
Registered: Mar 2012
Posts: 115

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bathory View Post
You can use mod_rewrite to redirect the homepage "/" to "/pogi/namech/login.do".
Then apache will send the new rewritten URL to the backend jboss:
Code:
RewriteEngine On
RewriteRule ^/$ /pogi/namech/login.do [R=301,L]
Hi Bathory,
It worked like a charm. One last (if I may still ask) "login.do" is a JSP type. what it does is once the login username/pass credentials are achieved it will sent post to login.do2. What happens is, once I type the login credentials from http://my_proxy_server/pogi/namech/login.do it looks for the login.do2 from my_proxy_server instead from http://172.30.55.80:8080/pogi/namech/login.do2

the errors:

Code:
Not Found

The requested URL /login.do2 was not found on this server.
from incognito via developer mode

Code:
Request URL:http://my_proxy_server/pogi/namech/login.do2
Request Method:POST
Status Code:404 Not Found
Remote Address:172.30.55.80
 
Old 08-18-2016, 02:21 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,526

Rep: Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503Reputation: 1503
Quote:
"login.do" is a JSP type. what it does is once the login username/pass credentials are achieved it will sent post to login.do2. What happens is, once I type the login credentials from http://my_proxy_server/pogi/namech/login.do it looks for the login.do2 from my_proxy_server instead from http://172.30.55.80:8080/pogi/namech/login.do2
Doh, maybe you should read the documentation of the application you're running to see if it needs some special settings if it's going to run behind a reverse proxy.

Anyway try the next 2 things and see if any of them helps
Use the following:
Code:
ProxyPreserveHost On
Add another couple of proxy directives for the URL in question (before the previous one):
Code:
...
ProxyPass /pogi/namech/login.do2 http://172.30.55.80:8080/pogi/namech/login.do2
ProxyPassReverse /pogi/namech/login.do2 http://172.30.55.80:8080/pogi/namech/login.do2
ProxyPass /pogi http://172.30.55.80:8080/pogi
ProxyPassReverse /pogi http://172.30.55.80:8080/pogi
...
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Redirect URL between php/html and static files on same domain rocklee44 Linux - Server 6 10-06-2015 10:48 PM
Redirect with URL not showing the new redirects URL link Apache RHEL 6 gdizzle Linux - Newbie 4 12-03-2013 04:09 AM
[SOLVED] Apache Proxy with NodeJS not downloading static files societymedia Linux - Newbie 2 09-11-2013 02:16 PM
how-to-redirect-webiste-from-apache-server-to-proxy-server puchchi Linux - Newbie 7 03-22-2013 03:13 PM
[SOLVED] Proxy redirect on Apache moyorakkhi Linux - Server 4 01-19-2012 11:58 PM


All times are GMT -5. The time now is 04:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration