proxy dynamic requests to apache

Igor Sysoev is at rambler-co.ru
Fri Jan 11 17:56:20 MSK 2008


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

> 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;
>         }
> 
> 
>    }
> -- 
> Posted via http://www.ruby-forum.com/.
> 

-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list