LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices

Reply
 
Search this Thread
Old 08-03-2011, 03:10 AM   #1
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Rep: Reputation: Disabled
Apache problem with proxy and reverseproxy


Hello

I have problem to set the right url to show in reverseproxy

Example:

ProxyPass /red/ http://11.11.1.1/school/f?p=2
ProxyPassReverse /red/ http://11.11.1.1/school/f?p=2
RewriteRule ^/red$ /red/ [R]

Request url ... is not allowed.


The problem is in f?p=2 exactly the ?


How to set url or rule
 
Old 08-03-2011, 12:52 PM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,905

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Hi,
Quote:
The problem is in f?p=2 exactly the ?
Well, I don't get exactly what you're trying to do, but I don't think you can proxy a URI like /red to a query string in the backend server.
Maybe this should do what you want:
Code:
RewriteEngine on
RewriteRule  ^/red$ http://11.11.1.1/school/f?p=2 [P,QSA]
 
Old 08-04-2011, 01:06 AM   #3
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
Your idea did not work.

What I am trynig to do.

When user from outside would write in URL some IP number, then will be redirected to Proxy server (https)

MY Proxy server
Linux Suse 11
192.1.0.1


And then when I would go from outside to 88.10.1.1, then I will be redirected to 192.1.0.1 and when I would add /red/, I will come to sharepoint


And this works(only with this one I have a problem, because is ? in url and apache convert this to %3F) - http://www.asciitable.com/

ProxyPass /red/ http://11.11.1.1/school/f?p=2
ProxyPassReverse /red/ http://11.11.1.1/school/f?p=2
RewriteRule ^/red$ /red/ [R]
 
Old 08-04-2011, 02:20 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,905

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
First of all you should ask a moderator to move this thread to the Server forum, where it will get more attention.

As I've told you I don't think this can work. mod_rewrite has the [NE] option to not convert special characters to hex, but it doesn't apply here.
You may proxy /red/ to /school/, so when a client visits http://192.168.0.1/red/f?p=2 it will get the correct url from the backend
 
Old 08-04-2011, 04:54 AM   #5
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
How can I wrote that ?

Is this OK.

ProxyPass /red/ http://11.11.1.1/red/f?p=2
ProxyPassReverse /school/ http://11.11.1.1/school/f?p=2
RewriteRule ^/red$ /red/ [R]
 
Old 08-04-2011, 05:26 AM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,905

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
No, I was thinking something like that:
Code:
ProxyPass /red/ http://11.11.1.1/school/
ProxyPassReverse /school/ http://11.11.1.1/school/
RewriteRule ^/red$ /red/ [R]
So whatever is passed after the /red/ URI at the proxy will be passed to /school/ at the backend
 
Old 08-04-2011, 05:36 AM   #7
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
It does not work

I also added AddDefaultCharset utf-8 and did not work


What else to do ?
 
Old 08-04-2011, 06:31 AM   #8
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,905

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Oups I've done a mistake
Quote:
ProxyPassReverse /school/ http://11.11.1.1/school/
It should be
Code:
ProxyPassReverse /red/ http://11.11.1.1/school/
Or maybe use the same for both, like:
Code:
ProxyPass /school/ http://11.11.1.1/school/
ProxyPassReverse /school/ http://11.11.1.1/school/
RewriteRule ^/red$ /school/ [R]
The hex character for the "?" is not a utf problem. It's the way apache represents special characters in urls
Other than that I don't know what else you can do. Maybe you should google to find if it's possible to reverse proxy your application and how
 
Old 08-04-2011, 07:02 AM   #9
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
Did not work.

I google and I didn't find the right stuff.


IF you have some idea, please
 
Old 08-04-2011, 09:03 AM   #10
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,905

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
You can check the logs on both apache and the backend server and see what happens.
 
Old 08-05-2011, 12:38 AM   #11
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
192.168.1.1 - firewall


acces.log
192.168.1.1 - - [05/Aug/2011:07:19:12 +0200] "GET / HTTP/1.1" 403 1017
192.168.1.1 - - [05/Aug/2011:07:19:20 +0200] "GET /apex/ HTTP/1.1" 404 1237


error.log
[Fri Aug 05 07:19:12 2011] [error] [client 192.168.1.1] Directory index forbidden by Options directive: /srv/www/htdocs/

sslrequesst.log
05/Aug/2011:07:19:12 +0200] 192.168.1.1 TLSv1 DHE-RSA-CAMELLIA256-SHA "GET / HTTP/1.1" 1017 "-" "Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0"
[05/Aug/2011:07:19:20 +0200] 192.168.1.1 TLSv1 DHE-RSA-CAMELLIA256-SHA "GET /apex/ HTTP/1.1" 1237 "-" "Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0"



I don't now, where to find backend log in linux suse server
 
Old 08-05-2011, 02:08 AM   #12
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,905

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
The backend is the server you're trying to proxy (the one with the 11.11.1.1 IP)
What happens if you try to access apache on 192.168.0.1 from itself: http://192.1.0.1/school/?
 
Old 08-05-2011, 03:25 AM   #13
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
Quote:
The backend is the server you're trying to proxy (the one with the 11.11.1.1 IP)
It's work.


Quote:
What happens if you try to access apache on 192.168.0.1 from itself: http://192.1.0.1/school/?
It's allso works.


This url(http://192.1.0.1/school/?) works from every computer, server,..

But not from proxy server
 
Old 08-05-2011, 03:43 AM   #14
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,905

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Quote:
The backend is the server you're trying to proxy (the one with the 11.11.1.1 IP)
It's work.
I know it works. Just ask to look at the logs to see what are the actual reverse proxy requests

Quote:
This url(http://192.1.0.1/school/?) works from every computer, server,..

But not from proxy server
Isn't the 192.1.0.1 the box running apache reverse proxy?
What other proxy you say?
 
Old 08-05-2011, 05:34 AM   #15
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
My mistake

This url(http://192.1.0.1/school/? - is proxy server (192.1.0.1) and it gives the same error when I type this URL


Quote:
I know it works. Just ask to look at the logs to see what are the actual reverse proxy requests

What log I have to see. From my computer, when I go to http://11.11.1.1/red/f?p=2


thanks
 
  


Reply

Tags
apache, proxy


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
apache proxy with rewrite problem xiutuo Linux - Server 3 12-01-2010 05:56 AM
[SOLVED] Apache Reverse Proxy - problem with configuration dlugasx Linux - Server 4 10-04-2010 06:44 AM
Should I be using apache proxy services to solve a real problem Loboexe Linux - Newbie 2 01-28-2009 09:25 AM
Can't figure out Apache VirtualHosts + Tomcat + ReverseProxy + RewriteRules rave8151 Linux - Server 3 07-16-2008 11:15 AM
Help! Apache Reverseproxy & cache server maheshk78 Linux - General 0 11-16-2006 01:26 AM


All times are GMT -5. The time now is 02:26 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration