Welcome! Log In Create A New Profile

Advanced

Re: Nginx Rewrite Apache?

Francis Daly
April 18, 2011 08:00AM
On Fri, Apr 15, 2011 at 05:36:09PM -0400, Adrian Janeczek wrote:

Hi there,

> This is uri but i use this conf

> and this not work

What do you expect to see it do; and what do you see it do instead?

As before, the debug log (http://nginx.org/en/docs/debugging_log.html)
is frequently helpful in finding the problem cause.


> location / {
> if (!-e $request_filename) {
> rewrite ^/(.*)$ /index.php?$1 last;
> }
> }

That may be better with try_files
(http://wiki.nginx.org/NginxHttpCoreModule#try_files), but probably
isn't the main problem you're seeing.

> location ~ .php($|/) {
>
> set $script $uri;
> set $path_info "";
>
> if ($uri ~ "^(.+.php)(/.+)") {
> set $script $1;
> set $path_info $2;
> }

Using "if" inside "location" for anything other than "return" or
"rewrite...last" is usually unwise. See http://wiki.nginx.org/IfIsEvil
for details.

In this case, I would suggest using fastcgi_split_path_info, since that's
what you're trying to do.

http://wiki.nginx.org/HttpFcgiModule#fastcgi_split_path_info

Good luck with it,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx Rewrite Apache?

Adrian Janeczek April 11, 2011 05:19PM

Re: Nginx Rewrite Apache?

António P. P. Almeida April 11, 2011 05:34PM

Re: Nginx Rewrite Apache?

Steve April 11, 2011 05:38PM

Re: Nginx Rewrite Apache?

Adrian Janeczek April 11, 2011 05:48PM

Re: Nginx Rewrite Apache?

Adrian Janeczek April 11, 2011 05:50PM

Re: Nginx Rewrite Apache?

Adrian Janeczek April 11, 2011 05:59PM

Re: Nginx Rewrite Apache?

Steve April 11, 2011 06:10PM

Re: Nginx Rewrite Apache?

Adrian Janeczek April 11, 2011 06:15PM

Re: Nginx Rewrite Apache?

Adrian Janeczek April 11, 2011 06:47PM

Re: Nginx Rewrite Apache?

António P. P. Almeida April 11, 2011 06:14PM

Re: Nginx Rewrite Apache?

Francis Daly April 11, 2011 06:16PM

Re: Nginx Rewrite Apache?

António P. P. Almeida April 11, 2011 06:24PM

Re: Nginx Rewrite Apache?

António P. P. Almeida April 11, 2011 05:52PM

Re: Nginx Rewrite Apache?

Adrian Janeczek April 15, 2011 05:36PM

Re: Nginx Rewrite Apache?

Francis Daly April 18, 2011 08:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 109
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready