Proxy dynamic requests to apache

hi guys,
this is my server config, that should pass dynamic requests, eg: php
pages, to apache listening to localhost.

i know i did it good and working in the past, but now i am missing
something and i don’t know what i did wrong. php pages are being parsed
by nginx now, and not sent to apache.

can you give me a clue?

thanks.

server {
listen 1.1.1.1:80;
server_name host1.net;
#charset koi8-r;
access_log logs/m1.e-muzica.net.access.log main;

    location / {
        root   /home/m1emuz/public_html;
        index  index.html index.htm index.php;
    }

    # serve static files directly
    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|flv|zip|mp3|txt)$ {
        root              /home/m1emuz/public_html;
        access_log        off;
        expires           30d;
    }

    location / {
        proxy_pass        http://localhost:8000/;
        proxy_redirect    off;
        proxy_set_header  X-Forwarded-For

$proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;

    }

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/local/www/nginx-dist;
    }

}

On Fri, Jan 11, 2008 at 03:45:10PM +0100, Stefanita rares Dumitrescu
wrote:

hi guys,
this is my server config, that should pass dynamic requests, eg: php
pages, to apache listening to localhost.

i know i did it good and working in the past, but now i am missing
something and i don’t know what i did wrong. php pages are being parsed
by nginx now, and not sent to apache.

can you give me a clue?

As it was already said, you have two the same locations:

     location / {

     location / {

Please, read http://wiki.codemongers.com/NginxHttpCoreModule#location

i really don’t get it:

i modified

    location ~* \.php$ {
        proxy_pass        http://localhost:8000/;
        proxy_redirect    off;
        proxy_set_header  X-Forwarded-For 

$proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;

[root@fs01:/usr/local/etc/nginx] ngr
nginx not running? (check /var/run/nginx.pid).
Starting nginx.
2008/01/11 15:17:53 [emerg] 56710#0: “proxy_pass” may not have URI part
in location given by regular expression, or inside named location, or
inside the “if” statement, or inside the “limit_except” block in
/usr/local/etc/nginx/nginx.conf:81

On Friday 11 January 2008, Stefanita rares Dumitrescu wrote:

        proxy_set_header  Host $http_host;

[root@fs01:/usr/local/etc/nginx] ngr
nginx not running? (check /var/run/nginx.pid).
Starting nginx.
2008/01/11 15:17:53 [emerg] 56710#0: “proxy_pass” may not have URI part
in location given by regular expression, or inside named location, or
inside the “if” statement, or inside the “limit_except” block in
/usr/local/etc/nginx/nginx.conf:81

1.2.3.4 - - [11/Jan/2008:15:37:34 +0100] GET /info.php HTTP/1.1 “404”
206 “-” “Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11)
Gecko/20071127 Firefox/2.0.0.11” “-”
1.2.3.4 - - [11/Jan/2008:15:37:34 +0100] GET /info.php HTTP/1.1 “404”
206 “-” “Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11)
Gecko/20071127 Firefox/2.0.0.11” “-”

it’s still going through nginx. the server started though.

if anyone has any idea. i would much appreciate. i read the
http://wiki.codemongers.com/NginxHttpCoreModule#location but i simply
don’t get it what am i doing wrong?