Problem accessing RT located behind an apache proxy

Hey Guys,

I am having issues accessing parts of my RT installation while it is located behind an apache proxy.

My configuration is:
RT is installed on a server on a private network.
Apache is installed on a server on the public network that will proxy with mod_rewrite access to the RT server.

This configuration works great for most parts of the RT system. Tickets can be looked at. Users can be added.
The problem occurs when a ticket or user is updated.

When a ticket is updated, Update.html is called, the ticket is update and the browser is redirected to Display.html.

The redirect is what is causing my problems. The application is tries to send the browser to the private IP address to load Display.html.

Here is my configuration:
Front end apache server:
Centos 4.5
httpd 2.0.52

Here are the rewrite rules:
<VirtualHost :80>
RewriteEngine on
RewriteLog /var/log/httpd/rewrite.log
RewriteLogLevel 2
RewriteRule ^/$ http://10.0.0.1/rt [P,L]
RewriteRule ^/(.
)$ http://10.0.0.1/$1 [P,L]
ProxyPass / http://rt.example.com/
ProxyPassReverse / http://rt.example.com/

Backend server:
Debian etch
Aapche 2
RT 3.6

My $WebBaseURL is http://rt.example.com

Any suggestions on what may be causing the rewrite to not work correctly?

Thanks for any help,

Keith

Most likely you’ll need to use something like mod_proxy_html to
manipulate occurances of the private address within the body of the http
stream. You could confirm this by using Wireshark to look at the
contents of the http replies on both sides of the Apache server and see
exactly where the offending addresses are being embedded.

mod_proxy_html is a perfect tool for doing in-line rewrites of
javascript, css and other complexities generated by proxied web apps.
See mod_proxy_html

Kris Boutilier
Information Services Coordinator
Sunshine Coast Regional District

[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Schincke,
Keith D. (JSC-IT)[MEI]Sent: Sunday, October 28, 2007 8:33 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Problem accessing RT located behind an
apache proxy

Hey Guys,

I am having issues accessing parts of my RT installation while

it is located behind an apache proxy.

My configuration is:
  RT is installed on a server on a private network.
  Apache is installed on a server on the public network that

will proxy with mod_rewrite access to the RT server.

This configuration works great for most parts of the RT system.

Tickets can be looked at. Users can be added.
The problem occurs when a ticket or user is updated.

When a ticket is updated, Update.html is called, the ticket is

update and the browser is redirected to Display.html.

The redirect is what is causing my problems. The application is

tries to send the browser to the private IP address to load
Display.html.

Here is my configuration:
Front end apache server:
Centos 4.5
httpd 2.0.52

Here are the rewrite rules:
<VirtualHost *:80>
   RewriteEngine on
   RewriteLog /var/log/httpd/rewrite.log
   RewriteLogLevel 2
   RewriteRule ^/$ http://10.0.0.1/rt [P,L]
   RewriteRule ^/(.*)$ http://10.0.0.1/$1 [P,L]
   ProxyPass / http://rt.example.com/
   ProxyPassReverse / http://rt.example.com/
</VirtualHost>


Backend server:
Debian etch
Aapche 2
RT 3.6

My $WebBaseURL is http://rt.example.com

Any suggestions on what may be causing the rewrite to not work

correctly?

Thanks for any help,

Keith

Hey Kris,

All of the html, images and javascript is loading correcting

I used firebug to peak at the HTTP headers. It looks like the “Location:” field is set to direct the browser to load the Display.html file to display the updated ticket.

The ProxyPass and ProxyPassReverse options should be changing the response headers.

Below is the relevant parts of my apache config file.

Any help will be greatfully appricated.

Keith

RewriteEngine on
RewriteLog /var/log/httpd/rewrite.log
RewriteLogLevel 0
RewriteRule ^/$ https://rt.example.com/rt/ [R,L]
RewriteRule ^/rt$ https://10.0.0.1/rt/ [P,L]
RewriteRule ^/rt/(.*)$ https://10.0.0.1/rt/$1 [P,L]

ProxyRequests off
SSLProxyEngine on

ProxyPass https://10.0.0.1/
ProxyPassReverse https://10.0.0.1/
-----Original Message-----
From: Kris Boutilier [mailto:Kris.Boutilier@scrd.bc.ca]
Sent: Mon 10/29/2007 11:38 AM
To: Schincke, Keith D. (JSC-IT)[MEI]
Cc: rt-users@lists.bestpractical.com
Subject: RE: [rt-users] Problem accessing RT located behind an apache proxy

Most likely you’ll need to use something like mod_proxy_html to manipulate occurances of the private address within the body of the http stream. You could confirm this by using Wireshark to look at the contents of the http replies on both sides of the Apache server and see exactly where the offending addresses are being embedded.

mod_proxy_html is a perfect tool for doing in-line rewrites of javascript, css and other complexities generated by proxied web apps. See mod_proxy_html

Kris Boutilier
Information Services Coordinator
Sunshine Coast Regional District

From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Schincke, Keith D. (JSC-IT)[MEI]
Sent: Sunday, October 28, 2007 8:33 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Problem accessing RT located behind an apache proxy




Hey Guys,

I am having issues accessing parts of my RT installation while it is located behind an apache proxy.

My configuration is:
  RT is installed on a server on a private network.
  Apache is installed on a server on the public network that will proxy with mod_rewrite access to the RT server.

This configuration works great for most parts of the RT system. Tickets can be looked at. Users can be added.
The problem occurs when a ticket or user is updated.

When a ticket is updated, Update.html is called, the ticket is update and the browser is redirected to Display.html.

The redirect is what is causing my problems. The application is tries to send the browser to the private IP address to load Display.html.

Here is my configuration:
Front end apache server:
Centos 4.5
httpd 2.0.52

Here are the rewrite rules:
<VirtualHost *:80>
   RewriteEngine on
   RewriteLog /var/log/httpd/rewrite.log
   RewriteLogLevel 2
   RewriteRule ^/$ http://10.0.0.1/rt [P,L]
   RewriteRule ^/(.*)$ http://10.0.0.1/$1 [P,L]
   ProxyPass / http://rt.example.com/
   ProxyPassReverse / http://rt.example.com/
</VirtualHost>


Backend server:
Debian etch
Aapche 2
RT 3.6

My $WebBaseURL is http://rt.example.com

Any suggestions on what may be causing the rewrite to not work correctly?

Thanks for any help,

Keith

Hi Keith,

Just a stab in the dark, have you tried ProxyPreserveHost On? I know it
rewrites the Host: value in the header, not sure if that would help RT.

Regards
Andrew

Schincke, Keith D. (JSC-IT)[MEI] wrote: