

![]() | 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: | Igor Sysoev (is-G...@public.gmane.org) | |
| Date: | Oct 23, 2007 9:33:46 am | |
| List: | ru.sysoev.nginx | |
On Tue, Oct 23, 2007 at 02:26:10PM -0200, Alejandro Vartabedian wrote:
;-) i tried something like this before posting the last mail, but i think this mixture is out of context (somebody correct me please), it's a rewrite module directive, and fastcgi params doesn't fit in it (yet ;).
i think i'm out of luck with the simplification/generalization of the config directives i pretend.
thank you all, i'm learning a lot about nginx...
You may use:
location ~ \.php$ { fastcgi_pass ... ... }
location ~ ^/(app1|app2)/ { root ... ... }
It's better do not use "if". Try to route request via locations only. If you want to pass non-existent files to FastCGI/proxy it's better to use:
location / { root ... error_page 404 = @fallback; }
location @fallback { fastcgi_pass ... ... }
Grzegorz Nosek escribi??:
2007/10/23, Alejandro Vartabedian
<lists-vk7gAcf3plJ9ZH2nltzS/ccKp...@public.gmane.org>:
well, doing this work:
location ~ /(app1|app2)/ { root /home/website/beta.ws/webroot/; index index.php index.html index.htm;
if (!-f $request_filename) {
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; }
but i'm charging to php to serve _all_ the data, dynamic and static one (correct?) is there a way to filter inside the location the php-cgi directives to serve directly the static content and avoid overcharging php? thanks.
Try wrapping fastcgi_pass in an `if' block, like above. Please check the variable name as I'm not 100% sure about it right now.
Best regards, Grzegorz Nosek
-- Igor Sysoev http://sysoev.ru/en/







