Welcome! Log In Create A New Profile

Advanced

Re: rewrite help please...

All files from this thread

File Name File Size   Posted by Date  
smime.p7s 6 KB open | download GreenGecko 12/09/2012 Read message
smime.p7s 6 KB open | download GreenGecko 12/09/2012 Read message
smime.p7s 6 KB open | download GreenGecko 12/09/2012 Read message
December 09, 2012 03:52PM
On Sun, 2012-12-09 at 10:29 +0000, Francis Daly wrote:

>
> Given your above configuration, am I right that what you want is:
>
> http://www.example.com/ -> php-process /usr/local/nginx/html/index.php
> http://www.example.com/index.php -> php-process /usr/local/nginx/html/index.php
> http://www.example.com/file.png -> send /usr/local/nginx/html/file.png
> http://www.example1.com/ -> php-process /usr/local/nginx/html/link/example1/index.php
> http://www.example1.com/index.php -> php-process /usr/local/nginx/html/index.php
> http://www.example1.com/file.png -> send /usr/local/nginx/html/file.png
>
> where in each case "send" or "php-process" means "respond http 200 with
> the output of that file"?
>
> > As the comment says, this does work if I use a rewrite ... redirect; but
> > the URL then changes to http://www.example1.com/link/example1, whereas I
> > want to see http://www.example1.com alone.
> >
> > The try_files comes up with a 404, which is really perplexing... I
> > expected it to go through the .php block like the others!
>
> After "location -> if -> anything else", I find it's usually not worth
> wondering why things do or don't work as hoped. You're in "here be
> dragons" territory anyway. That's nginx.
>
> > Any ideas what I'm doing wrong?
>
> With the assumptions and changes from above, maybe
>
> location = / {
> fastcgi_pass unix:php.sock;
> include fastcgi_params;
> fastcgi_param SCRIPT_FILENAME $document_root$page_redirect;
> }
>
> is closer to what you want?
>
> Good luck with it,

Thanks for the ideas Francis, it's cleaned up my config no end!

This is a WordPress site, so all requests have to go to /index.php to be
processed. The URL dictates the page returned.

I can't seem to find a way of mimicing what I'm trying to do with your
method, no matter what fastcgi_params I try setting up.

Cheers,


Steve

--
Steve Holdoway BSc(Hons) MIITP
http://www.greengecko.co.nz
Skype: sholdowa
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Attachments:
open | download - smime.p7s (6 KB)
Subject Author Posted

rewrite help please... Attachments

GreenGecko December 09, 2012 01:08AM

Re: rewrite help please...

Francis Daly December 09, 2012 05:30AM

Re: rewrite help please... Attachments

GreenGecko December 09, 2012 03:52PM

Re: rewrite help please... Attachments

GreenGecko December 09, 2012 04:08PM

Re: rewrite help please...

Francis Daly December 10, 2012 02:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
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