Welcome! Log In Create A New Profile

Advanced

Re: fastcgi, try_files, problems

Tomasz Pajor
July 17, 2009 05:35AM
Maxim Dounin wrote:



>> There is no /administrator/index.php file.
>> I want to simply separate the administrator backend, and serve it from
>> the same machine as balancer, because i've got all the gallery photos on
>> this machine.
>>
>
> So there is no /disk0/vhosts/domain/public/administrator directory
> at all, am I right?
>
No there isn't.
>
>> I'm migrating this from apache.
>>
>> .htaccess says:
>> RewriteEngine On
>> RewriteCond %{REQUEST_FILENAME} -s [OR]
>> RewriteCond %{REQUEST_FILENAME} -l [OR]
>> RewriteCond %{REQUEST_FILENAME} -d
>> RewriteRule ^.*$ - [NC,L]
>> RewriteRule ^.*$ index.php [NC,L]
>>
>
> As far as I understand you basically need to pass everything to
> fastcgi while rewriting everything that doesn't exist to
> index.php? Try something like this:
>
> root /disk0/vhosts/domain/public;
>
> fastcgi_index index.php;
>
> location / {
> try_files $uri $uri/ @fallback;
> fastcgi_pass apps;
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
> ...
> }
>
> location @fallback {
> fastcgi_pass apps;
> fastcgi_param SCRIPT_FILENAME $document_root/index.php;
> ...
> }
>
> location /administrator/ {
> rewrite ^/administrator(.*) $1 break;
> try_files $uri $uri/ @adminfallback;
> fastcgi_pass 127.0.0.1:3000;
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
> ...
> }
>
> location @adminfallback {
> fastcgi_pass 127.0.0.1:3000;
> fastcgi_param SCRIPT_FILENAME $document_root/index.php;
> ...
> }
>
>
It works flawlessly thank You Maxim!
Subject Author Posted

fastcgi, try_files, problems

Tomasz Pajor July 16, 2009 08:06AM

Re: fastcgi, try_files, problems

Maxim Dounin July 16, 2009 08:41AM

Re: fastcgi, try_files, problems

Tomasz Pajor July 16, 2009 09:07AM

Re: fastcgi, try_files, problems

Maxim Dounin July 16, 2009 01:58PM

Re: fastcgi, try_files, problems

Tomasz Pajor July 17, 2009 05:35AM

Resuming http request processing

Marcus Clyne July 17, 2009 07:17PM

Re: Resuming http request processing

bbm September 05, 2009 08:33AM

Re: fastcgi, try_files, problems

mike July 16, 2009 12:42PM

Re: fastcgi, try_files, problems

Dick Middleton July 16, 2009 08:48AM

Re: fastcgi, try_files, problems

Maxim Dounin July 16, 2009 09:18AM



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: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready