rewrite difficulty

Jonathan Matthews contact at jpluscplusm.com
Tue Apr 30 14:01:14 UTC 2013


On 30 April 2013 03:36, tseveendorj <tseveendorj at gmail.com> wrote:
> Hello,
>
> I have difficulty to convert apache like rewrite to nginx. This is my config
> file of virtualhost on nginx.  http://pastebin.com/HTtKXnFy

OMFG. You win today's prize for "Nginx config I am least likely even
to /try/ and change". Congrats! ;-)

> My installed php script should have following rewrite
> http://pastebin.com/M2h3uAt3
>
> Currently any requested php code displayed it's source on browser. How could
> I migrate ?

You need to start small. Learn how Nginx does its thing in one small
area and when you've understood that, move on the next.

At the moment, you have literally picked up your apache config and
dumped it into Nginx's config syntax. You are unlikely to succeed if
you don't learn how to work *with* Nginx, instead of trying just to
make it behave like Apache.

This may not be the "here's your config; I fixed it" reply you were
looking for, but it's the best I can give you. Your Nginx config is
/horrible/, and I'm not going to spend my time deciphering it! :-)

Have a *really* good read of
http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite and
http://wiki.nginx.org/HttpRewriteModule. They'd be good places to
start ...

J
--
Jonathan Matthews // Oxford, London, UK
http://www.jpluscplusm.com/contact.html



More information about the nginx mailing list