

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
15 messages in ru.sysoev.nginxRe: php and locations with regex (rou...| From | Sent On | Attachments |
|---|---|---|
| Alejandro Vartabedian | Oct 23, 2007 3:43 am | |
| Alejandro Vartabedian | Oct 23, 2007 7:16 am | |
| Igor Sysoev | Oct 23, 2007 7:29 am | |
| Maxim Dounin | Oct 23, 2007 7:33 am | |
| Alejandro Vartabedian | Oct 23, 2007 7:42 am | |
| Alejandro Vartabedian | Oct 23, 2007 7:44 am | |
| Alejandro Vartabedian | Oct 23, 2007 8:37 am | |
| Grzegorz Nosek | Oct 23, 2007 8:43 am | |
| Alejandro Vartabedian | Oct 23, 2007 9:25 am | |
| Igor Sysoev | Oct 23, 2007 9:33 am | |
| Alejandro Vartabedian | Oct 23, 2007 10:55 am | |
| Grzegorz Nosek | Oct 24, 2007 1:31 am | |
| Igor Sysoev | Oct 24, 2007 3:00 am | |
| Igor Sysoev | Oct 24, 2007 3:23 am | |
| Alejandro Vartabedian | Oct 24, 2007 5:40 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: php and locations with regex (round 2) | Actions... |
|---|---|---|
| From: | Alejandro Vartabedian (list...@public.gmane.org) | |
| Date: | Oct 23, 2007 7:44:46 am | |
| List: | ru.sysoev.nginx | |
thank's Igor, i've emailed a suspect of these before receiving your mail. i figured it out trying to alias a php app folder.
if anyone is interested in the config to alias static and dynamic content, i can post it.
thanks again...
Igor Sysoev escribió:
On Tue, Oct 23, 2007 at 08:44:21AM -0200, Alejandro Vartabedian wrote:
(trying to pay attention to the data i posting...)
well, i think i found a behavior pattern with my problem about regexed locations and php scripts. i tried very simple tests to figure out the behavior i getting from the server. the case is this: _ 2 subdirs, app1 and app2 _ 2 files in each subdir index.html (hello world) and index.php (phpinfo) _ 2 different locations configs, with and without regex _ 2 different indexes en each app subdir, app1->index.php and app2->index.html
config 1:
server { listen 80; server_name www.beta; #somename alias another.alias;
# access_log /var/log/nginx/beta.access.log;
location / { root /home/website/beta.ws/webroot/; index index.php index.html index.htm; }
location /app1/ { root /home/website/beta.ws/webroot/; index index.php index.html index.htm; }
location /app2/ { root /home/website/beta.ws/webroot/; index index.html index.htm; }
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:8888 # location ~ .php$ { fastcgi_pass 127.0.0.1:8888; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/website/beta.ws/webroot$fastcgi_script_name; include /etc/nginx/fastcgi_params; }
} the behavior is as expected:
http://www.beta/app1/ => index.php's phpinfo output http://www.beta/app2/ => index.html's html hello world output
http://www.beta/app1/index.php => index.php's phpinfo output http://www.beta/app2/index.php => index.php's phpinfo output
until now all is ok.
now the config with a _minimal_ regex variation: server { listen 80; server_name www.beta; #somename alias another.alias;
# access_log /var/log/nginx/beta.access.log;
location / { root /home/website/beta.ws/webroot/; index index.php index.html index.htm; }
location ~ ^/(app1)/ { root /home/website/beta.ws/webroot/; index index.php index.html index.htm; }
location ~ ^/(app2)/ { root /home/website/beta.ws/webroot/; index index.html index.htm; }
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:8888 # location ~ .php$ { fastcgi_pass 127.0.0.1:8888; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/website/beta.ws/webroot$fastcgi_script_name; include /etc/nginx/fastcgi_params; }
}
the behavior isn't as expected:
http://www.beta/app1/ => BIN file to download, 13ax1epp.bin containing the index.php source code http://www.beta/app2/ => index.html's html hello world output
http://www.beta/app1/index.php => index.php's source code with a correct mime recognition http://www.beta/app2/index.php => index.php's source code with a correct mime recognition
well, it seems that as an automatic index the php file is returned with some internal file name? with a .bin extension for download, containing the script source code. but if it's called directly by the browser url it's returned with the correct name but without been parsed by the fastcgi.
http://wiki.codemongers.com/NginxHttpCoreModule#location
------ The first regular expression to match the query will stop the search.
------







