eZHTTPTool::redirect and reverse proxy

Author Message

Guillaume Mouricou

Friday 12 June 2009 6:12:41 am

Hello,

When a reverse proxy is used, the eZ Publish redirect are wrong.

eZHTTPTool::redirect() use eZSys::hostName() to get the hostName, that function use $_SERVER['HTTP_HOST'] which is the same as the Host header in the HTTP request. So the hostname of the webserver will be used instead of the hostname of the reverse proxy server.

Can I configure eZ Publish to resolve this issue?

Best regards.

Guillaume Mouricou

Gaetano Giunta

Saturday 13 June 2009 3:29:50 am

Looking at http://issues.ez.no/1304 it seems like this has been a known problem for a long time...

Principal Consultant International Business
Member of the Community Project Board

Gaetano Giunta

Saturday 13 June 2009 3:32:02 am

... otoh looking at http://issues.ez.no/11695 it seems like it will be fixed in the next round of upgrades!

Principal Consultant International Business
Member of the Community Project Board

Kristof Coomans

Saturday 13 June 2009 10:49:25 am

If you are using Apache as reverse proxy, then use the ProxyPassReverse directive to adjust the Location HTTP header, see http://httpd.apache.org/docs/1.3/mod/mod_proxy.html#proxypassreverse. I guess other reverse proxy software has such configuration option as well.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Guillaume Mouricou

Monday 15 June 2009 7:44:04 am

Ok.

Thanks for your replies.

Guillaume Mouricou

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 18:34:49
Script start
Timing: Jan 18 2025 18:34:49
Module start 'layout'
Timing: Jan 18 2025 18:34:49
Module start 'content'
Timing: Jan 18 2025 18:34:49
Module end 'content'
Timing: Jan 18 2025 18:34:49
Script end

Main resources:

Total runtime0.0158 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 588.0391152.6406
Module start 'layout' 0.00720.0026 740.679739.4922
Module start 'content' 0.00980.0045 780.171993.2734
Module end 'content' 0.01430.0015 873.445334.3047
Script end 0.0158  907.7500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002314.6918140.0002
Check MTime0.00116.7610140.0001
Mysql Total
Database connection0.00148.599210.0014
Mysqli_queries0.002415.072630.0008
Looping result0.00000.094810.0000
Template Total0.00127.610.0012
Template load0.00064.034610.0006
Template processing0.00063.548410.0006
Override
Cache load0.00052.886010.0005
General
dbfile0.00031.628980.0000
String conversion0.00000.058740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs