php for a particular html page
November 21, 2016 01:10PM
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



Edited 4 time(s). Last edit at 11/21/2016 01:12PM by strangemonkey.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 218
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready