LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 09-01-2011, 08:33 AM   #31
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,167
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038

Hi,

Quote:
RewriteCond %{HTTP} ^on$
The above is wrong. There is no such variable. I guess that's why rewrite is not working
Also, better use:
Code:
RewriteCond %{REQUEST_URI} ^/123(.*)$
to take care of the trailing slash "/"
And I don't understand the last rewrite rule after the proxy stuff.
Quote:
RewriteRule ^/123/(.*) http://192.0.1.1:88/ap/ [L,R]
After fixing the url with mod_rewrite, the proxy should take control for the rest.

Regards
 
Old 09-02-2011, 02:16 AM   #32
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 29

Original Poster
Rep: Reputation: Disabled
Now is my configuration like this:


My proxy: 192.0.0.0 (DMZ)

My httpd.conf


AddDefaultCharset utf-8

RewriteEngine On

Options +FollowSymlinks



RewriteCond %{REQUEST_URI} ^/123/(.*)$

RewriteCond %{REQUEST_URI} !^/123/f$

RewriteRule (.*) /123/f?p=100:1 [R]



ProxyRequests Off

ProxyPass /123/ http://192.0.1.1:88/ap/

ProxyPassReverse /123/ http://192.0.1.1:88/ap/



Now i think that this RewriteCond works, but there is still a problem.


1.

When I write URL - proxy - https://192.0.0.0/123/ I become http://192.0.1.1:88/ap/ (my administrator console) -
But I wont this URL -> https://192.0.1.1:88/ap/f?p=100:1

It's look that here, where is https, RewriteCond does not work. What to change ??

My proxy has to work with https.


2.

When I write URL - proxy - http://192.0.0.0/123/ I become the right URL -> https://192.0.1.1:88/ap/f?p=100:1

But there is a problem

2.1

I become login, but it looks that something did not go true proxy.

Picture 1 - the login page when she came true proxy.
Picture 2 - the login page from application

Where is here problem.


Thanks for your time
Attached Thumbnails
Click image for larger version

Name:	1.JPG
Views:	24
Size:	5.6 KB
ID:	7921   Click image for larger version

Name:	2.JPG
Views:	17
Size:	5.1 KB
ID:	7922  
 
Old 09-02-2011, 03:02 AM   #33
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,167
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
Quote:
When I write URL - proxy - https://192.0.0.0/123/ I become http://192.0.1.1:88/ap/ (my administrator console) -
But I wont this URL -> https://192.0.1.1:88/ap/f?p=100:1

It's look that here, where is https, RewriteCond does not work. What to change ??
I don't understand what you mean. If a request is done through https then it cannot be turned in http without a rewrite action from you, that is not happening here!
Anyway, why don't you use https in the proxied url?

Quote:
When I write URL - proxy - http://192.0.0.0/123/ I become the right URL -> https://192.0.1.1:88/ap/f?p=100:1
I've already told you to remove the trailing slash exactly for this reason

Quote:
I become login, but it looks that something did not go true proxy.
Huh, maybe you need ProxyPreserveHost On. This depends mostly on the backend application.

You may try this:
Code:
RewriteCond %{REQUEST_URI} ^/123(.*)$
RewriteCond %{REQUEST_URI} !^/123/f$
RewriteRule (.*) /123/f?p=100:1 [R]

ProxyPreserveHost On
ProxyRequests Off
ProxyPass /123/ https://192.0.1.1:88/ap/
ProxyPassReverse /123/ https://192.0.1.1:88/ap/
 
Old 09-02-2011, 03:58 AM   #34
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 29

Original Poster
Rep: Reputation: Disabled
Quote:
why don't you use https in the proxied url?
Because application does not work on https


Quote:
When I write URL - proxy - http://192.0.0.0/123/ I become the right URL -> http://192.0.1.1:88/ap/f?p=100:1
I've already told you to remove the trailing slash exactly for this reason
Where I have to remove slash ??
 
Old 09-02-2011, 04:11 AM   #35
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 29

Original Poster
Rep: Reputation: Disabled
LOGS


Proxy_ssl error

[Fri Sep 02 10:30:13 2011] [debug] mod_proxy_http.c(56): proxy: HTTP: canonicalising URL //192.0.0.0:88/ap/f

[Fri Sep 02 10:30:13 2011] [debug] proxy_util.c(1489): [client 192.0.0.0] proxy: http: found worker http://192.0.1.1/ap/ for http://192.0.1.1:88/ap/f?p=100:1, referer: http://192.0.1.1/123/f?p=100:1

[Fri Sep 02 10:30:13 2011] [debug] mod_proxy.c(988): Running scheme http handler (attempt 0)

[Fri Sep 02 10:30:13 2011] [debug] mod_proxy_http.c(1924): proxy: HTTP: serving URL http://192.0.1.1:88/ap/f?p=100:1

[Fri Sep 02 10:30:13 2011] [debug] proxy_util.c(2045): proxy: HTTP: has acquired connection for (192.0.0.1)

[Fri Sep 02 10:30:13 2011] [debug] proxy_util.c(2103): proxy: connecting http://192.0.1.1:88/ap/f?p=100:1 to 192.0.1.1:88

[Fri Sep 02 10:30:13 2011] [debug] proxy_util.c(2201): proxy: connected /ap/f?p=100:1 to 192.0.1.1:88

[Fri Sep 02 10:30:13 2011] [debug] proxy_util.c(2356): proxy: HTTP: fam 2 socket created to connect to 192.0.1.1

[Fri Sep 02 10:30:13 2011] [debug] proxy_util.c(2468): proxy: HTTP: connection complete to 192.0.1.1:88 (192.0.1.1)

[Fri Sep 02 10:30:13 2011] [debug] mod_proxy_http.c(1701): proxy: start body send

[Fri Sep 02 10:30:13 2011] [info] [client 192.0.0.0] (32)Broken pipe: core_output_filter: writing data to the network

[Fri Sep 02 10:30:13 2011] [debug] mod_proxy_http.c(1790): proxy: end body send

[Fri Sep 02 10:30:13 2011] [debug] proxy_util.c(2063): proxy: HTTP: has released connection for (192.0.1.1)

[Fri Sep 02 10:30:13 2011] [info] [client 192.0.0.0] (32)Broken pipe: core_output_filter: writing data to the network


Rewrite log


192.0.0.0 - - init rewrite engine with requested uri /

(3) applying pattern '(.*)' to uri '/'


init rewrite engine with requested uri /error/HTTP_FORBIDDEN.html.var

applying pattern '(.*)' to uri '/error/HTTP_FORBIDDEN.html.var'

RewriteCond: input='/error/HTTP_FORBIDDEN.html.var' pattern='^/123/(.*)$' => not-matched

(1) pass through /error/HTTP_FORBIDDEN.html.var





init rewrite engine with requested uri /123/

applying pattern '(.*)' to uri '/123/'

RewriteCond: input='/123/' pattern='^/123/(.*)$' => matched

RewriteCond: input='/123/' pattern='!^/123/f$' => matched

rewrite '/123/' -> '/123/f?p=100:1'

split uri=/123/f?p=100:1 -> uri=/123/f, args=p=100:1

explicitly forcing redirect with http://192.0.0.0/123/f

http://192.0.0.0/alis/f for redirect

redirect to http://192.0.0.0/123/f?p=1000:1 [REDIRECT/302]
RewriteCond: input='/i/themes/theme_2/theme_3_1.css' pattern='^/123/(.*)$' => not-matched




(2) init rewrite engine with requested uri /error/contact.html.var

(1) pass through /error/contact.html.var

(2) init rewrite engine with requested uri /123/f

(3) applying pattern '(.*)' to uri '/123/f'

(4) RewriteCond: input='/123/f' pattern='^/123/(.*)$' => matched

(4) RewriteCond: input='/123/f' pattern='!^/123/f$' => not-matched

(1) pass through /123/f

Last edited by sameone; 09-02-2011 at 05:57 AM.
 
Old 09-02-2011, 05:00 AM   #36
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,167
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
Quote:
Originally Posted by sameone View Post
Because application does not work on https




Where I have to remove slash ??
How comes it doesn't work on https when you say
Quote:
But I wont this URL -> https://192.0.1.1:88/ap/f?p=100:1
If you want the initial request to be in https then before the other rewrite stuff, add:
Code:
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}
About the trailing slash. Remove this (in red):
Code:
RewriteCond %{REQUEST_URI} ^/123/(.*)$
I hope that it's clear now!
 
Old 09-02-2011, 05:56 AM   #37
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 29

Original Poster
Rep: Reputation: Disabled
Quote:
How comes it doesn't work on https when you say
Quote:
But I wont this URL -> https://192.0.1.1:88/ap/f?p=100:1

My mistake when writting - -> http://192.0.1.1:88/ap/f?p=100:1


Quote:
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}
Ok this work and convert http to https



Quote:
RewriteCond %{REQUEST_URI} ^/123/(.*)$
That only means url with http://192.0.0.0/123/ or without http://192.0.0.0/123


Any idea about problem


I canlogin, but it looks that something did not go true proxy.

Picture 1 - the login page when she came true proxy.
Picture 2 - the login page from application

Where is here problem.
 
Old 09-02-2011, 06:50 AM   #38
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,167
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
Quote:
RewriteCond %{REQUEST_URI} ^/123/(.*)$
That only means url with http://192.0.0.0/123/ or without http://192.0.0.0/123
If you want both (with or without the /) to work, use my rewrite rule: REMOVE THE SLASH!!!
You should read mod_rewrite documentation and especially the use of regexes.

Quote:
I canlogin, but it looks that something did not go true proxy.
So, anything else works except the images in the login page?
Check the logs in both apache and the backend server and see why is this happening.
 
Old 09-02-2011, 07:00 AM   #39
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 29

Original Poster
Rep: Reputation: Disabled
Quote:
So, anything else works except the images in the login page?
If It was so, then would be OK. I only become the login page. But login does not work. No response from button (LOGIN) and so on.

It looks that I only become true proxy html page, without connection ...



Quote:
Check the logs in both apache and the backend server and see why is this happening.
I send you my log. Did you find something ...
 
Old 10-10-2011, 04:38 AM   #40
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 29

Original Poster
Rep: Reputation: Disabled
Have anyone Idea how to set sercured proxy server ??


Please help
 
  


Reply

Tags
apache, proxy



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

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 10:37 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
Open Source Consulting | Domain Registration