Trailing slash rewrite help

Kurt Hansen khansen at charityweb.net
Tue Jul 21 18:07:12 MSD 2009


Hello,

Igor Sysoev wrote:
> On Mon, Jul 20, 2009 at 11:14:06AM -0400, Kurt Hansen wrote:
>
>   
>> Igor Sysoev wrote:
>>     
>>> On Sat, Jul 18, 2009 at 01:28:12AM -0400, Kurt Hansen wrote:
>>>  
>>>       
>>>> Hello,
>>>>
>>>> I'm using nginx as a reverse proxy to a mod_perl backend server and am 
>>>> having trouble with my rewrite rule in the case of a missing trailing 
>>>> slash on a subdirectory.
>>>>
>>>> For example, I want
>>>>
>>>> www.example.com/action mapped to the example/action/ directory on the 
>>>> mod_perl server.
>>>>
>>>>
>>>>    
>>>>         
>>> Probably, you need just:
>>>
>>> location / {
>>>    proxy_pass http://cweb/example/;It 
>>> }
>>>
>>> Also, you need to set "Index index.htm" on mod_perl side.
>>>
>>>  
>>>       
>> Thanks, Igor, that did the trick!
>>
>> Thought I was missing something simple...
>>
>> Key, too, was getting the mod_perl server to specify the index.htm 
>> rather than the nginx server. I used a rewrite rule to do that because 
>> my apache/mod_perl with HTML::Mason setup doesn't handle the 
>> DirectoryIndex quite right.
>>     
>
> It should work, what do you see when you request "/" or "/action/" ?
>
>   
Yes, the proxy_pass change did work! Sorry I was a bit unclear. :-) I 
didn't mean for you to spend any more time on this.

My further explanation was primarily for folks who might be using the 
same setup as I am and looking through the archives.

No need to respond any further, Igor. You fixed the problem already! :-)

Take care,

Kurt





More information about the nginx mailing list