Rewrite

thinkbot nginx-forum at nginx.us
Mon Nov 30 16:52:31 MSK 2009


One more thing,
Is there a way to redirect from location rss.xml, to location / depends on the args ?

               location = /rss.xml {
                       root /home/site/public_html;
                       access_log      off;
                       expires 10m;

                       if ($args ~ "^type=popular&cid=(\d+)") {
                               set $cid $1;
                               rewrite ^ /cache_sql/rss/popular_$cid.xml break;
                       }

                       if ($args ~ "^type=search") {
                               #redirect to location /
                       }
               }

                location / {
                        root /home/site/public_html;
                        access_log      off;
                        proxy_pass http://localhost:8080;
                        proxy_redirect off;
                        proxy_set_header X-Real-IP  $remote_addr;
                        proxy_set_header Host $host;
                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                }

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,26530,26746#msg-26746





More information about the nginx mailing list