Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

php for a particular html page

$
0
0
I'd like nginx to parse particular html page(s) as php

- for example, I have a php contact form I'd like to keep calling contact.html,

but don't need php on most of my other html pages.

I've been able to parse _all_ html pages with these:

in virtual.conf -

#location ~ \.php$ {
location ~ \.(php|html|htm)$ {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/website$fastcgi_script_name;
include fastcgi_params;

}

in /etc/php-fpm.d/www.conf -

security.limit_extensions = .html .php .php3 .php4 .php5

but feel it's overkill and could hurt nginx performance?

Thanks,
sm

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>