Rewrite questions

Brendan Schwartz bschwartz at tropist.com
Tue Jan 22 22:35:34 MSK 2008


On Jan 22, 2008 11:44 AM, Andreas Otto <andreas.otto at dkd.de> wrote:
> Hi,
>
> I am quite new to nginx and already ran into some troubles with
> rewriting URLs.
>
> If the cliewnt requests a URL like http://www.example.com/en/something/
> I would like to have nginx looking if a file exists in
> /document_root/typo3temp/some_typo3_extension/www.example.com/en/something/index.html
>
> And if the file exists nginx shoudl send it to the client, not apache.
>
> No matter what I try itz is always apache who delivers the content to
> the client.
>
> Any ideas?
>
>
> Cheers,
> Andreas
>
>

Hi Andreas,

Take a look at this example configuration:
http://wiki.codemongers.com/NginxRubyonRailsMongrel

The important pieces there are the root directive: "root
/var/www/apps/example/current/public;"
And the if statements:
      if (-f $request_filename/index.html) {
        rewrite (.*) $1/index.html break;
      }

You'll want to set your root to
"/document_root/typo3temp/some_typo3_extension/www.example.com" and
include an if statement like the one above.

If you can't get this working, please provide your nginx.conf file so
others can assist you more easily.

Brendan





More information about the nginx mailing list