Welcome! Log In Create A New Profile

Advanced

Separate folder from Zend framework

Posted by alexk 
Separate folder from Zend framework
October 08, 2009 04:52PM
Hi,

What I want to do is separate /admin/ folder from rules that I use for zend framework in root of the site - redirecting everything to index.php. /admin/ folder should work in different way. It should execute each script that physically exists there.

I've tried the following configuration but when I request /admin/index.php browser just offer to save it.

[code]
location / {
root /var/www/khayar/public;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;

fastcgi_store on;
fastcgi_store_access user:rw group:rw all:r;

charset utf-8;

fastcgi_param SCRIPT_FILENAME /var/www/khayar/public/index.php;
include fastcgi_params;
index index.php;
}

location ~ "(\/userfiles\/)|(\.(log|pdf|ttf|fon|js|ico|txt|xml|html|dtd|gif|jpg|png|css|rss|zip|$s|zip|tar\.gz))$" {
root /var/www/khayar/public;
expires max;
}

location /admin/ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME /var/www/khayar/public$fastcgi_script_name;
include fastcgi_params;
}

location ~ /\.ht {
deny all;
}
[/code]


It's running on nginx-0.6.39. Any help will be appreciated.

Thanks,
Alex Kleshchevnikov
www.klalex.com
Jason
Re: Separate folder from Zend framework
October 09, 2009 08:02AM
Check your scrip_filename line, still pointing to the public location.
If /admin/ is a real location for the root, it should be part of that
param path.


On Oct 8, 4:52 pm, "alexk" <nginx-fo...@nginx.us> wrote:
> Hi,
>
> What I want to do is separate /admin/ folder from rules that I use for zend framework in root of the site - redirecting everything to index.php. /admin/ folder should work in different way. It should execute each script that physically exists there.
>
> I've tried the following configuration but when I request /admin/index.php browser just offer to save it.
>
> location / {
>     root   /var/www/khayar/public;
>     fastcgi_pass   127.0.0.1:9000;
>     fastcgi_index  index.php;
>
>     fastcgi_store           on;
>     fastcgi_store_access    user:rw  group:rw  all:r;
>
>     charset utf-8;
>
>     fastcgi_param  SCRIPT_FILENAME /var/www/khayar/public/index.php;
>     include        fastcgi_params;
>     index          index.php;
>
> }
>
> location ~ "(\/userfiles\/)|(\.(log|pdf|ttf|fon|js|ico|txt|xml|html|dtd|gif|jpg|png|cs s|rss|zip|$s|zip|tar\.gz))$" {
>     root /var/www/khayar/public;
>     expires max;
>
> }
>
> location /admin/ {
>     fastcgi_pass    127.0.0.1:9000;
>     fastcgi_index   index.php;
>
>     fastcgi_param   SCRIPT_FILENAME /var/www/khayar/public$fastcgi_script_name;
>     include         fastcgi_params;
>
> }
>
> location ~ /\.ht {
>     deny  all;
>
> }
>
> It's running on nginx-0.6.39. Any help will be appreciated.
>
> Thanks,
> Alex Kleshchevnikovwww.klalex.com
>
> Posted at Nginx Forum:http://forum.nginx.org/read.php?3,12172,12172#msg-12172
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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