Welcome! Log In Create A New Profile


try_files on windows

April 07, 2011 04:43AM
We use nginx in production (linux) and as development machines on windows.
The following is on Windows (I didn't test on linux),
case 1: try_files $uri $uri/index.php; -> works fine and shows the page index.php
case 2: try_files $uri $uri/index.php $bootstrap; -> shows the $bootstrap page even if $uri/index.php exists
case 3: try_files $uri $bootstrap; -> works fine and shows $bootstrap as it should

I can't get it to work in case 2. I also tried index index.php; but it still doesn't work
It seems like a pretty basic requirement and I don't understand why it wouldn't work fairly simply. Has anyone else encountered this problem and enlighten me whether it's a bug or am I doing something wrong?

In case someone wishes to see the full setup, here it is

server {
listen 80;
server_name ~^.+alpha.+$ ;

set $server d:/BeoAppSrv ;
set $bootstrap /public/alpha/bootstrap.php ;

root $server$myroot ;

access_log ./../../var/log/nginx/http-alpha.log debug0 ;
index index.php;# index.html index.htm index.php ;

if ($host ~* "^([^.]+(\.[^.]+)*)\.alpha\.local\.((.*)\.(com|net|org)(\..*)?)$") {
set $dom $3;
set $sub $1;

if ($host ~* "^alpha\.local\.(([^.]+)\.((com|net|org)(\..*)?$))") {
set $dom $1;
set $sub www;

set $myroot /public/alpha/sites/$dom/$sub/htdocs ;

location ~ \.(jpg|jpeg|png|gif|swf|flv|mp4|mov|avi|wmv|m4v|mkv|ico|js|css|xml|xslt)$ {
gzip on;
gzip_comp_level 2;
gzip_vary on;
gzip_proxied any;
gzip_types text/plain text/xml text/css application/x-javascript;
expires 365d;

location ^~ /ui/ { alias ./../../public/ui/; }

try_files $uri $uri/index.php $bootstrap?$uri&$args;

location ~ \.php$ {
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $server$myroot$fastcgi_script_name;
include fastcgi_params;
Subject Author Posted

try_files on windows

vladanpopovic@be-o.com April 07, 2011 04:43AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

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