Rewrite rule to parse .html to .php?

Joe Shang joe.shang at gmail.com
Thu Nov 27 20:10:14 MSK 2008


Without editing:

                location ~ \.php$ {
                        include conf/fastcgi_params;
                        fastcgi_pass unix:/home/nginx/phpcgi/USERNAME;
                        fastcgi_index index.php;
                }

Is there a way to add in nginx to send any *.html requests to as *.php to
Nginx?

Without having to add another directive like:

                location ~ \.html$ {
                        include conf/fastcgi_params;
                        fastcgi_pass unix:/home/nginx/phpcgi/USERNAME;
                        fastcgi_index index.php;
                }

Just to do what I want.

I am developing a backend for Nginx for in a shared-hosting environment,
just I don't want to give customers access to edit this part of the config,
so looking for a rewrite rule if possible to send *.html to *.php , or
anything in that concept.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20081127/7c37bc09/attachment.html>


More information about the nginx mailing list