Rewrite questions

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

On Jan 22, 2008 11:44 AM, Andreas Otto <andreas.otto at> wrote:
> Hi,
> I am quite new to nginx and already ran into some troubles with
> rewriting URLs.
> If the cliewnt requests a URL like
> I would like to have nginx looking if a file exists in
> /document_root/typo3temp/some_typo3_extension/
> 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:

The important pieces there are the root directive: "root
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/" 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.


More information about the nginx mailing list