Browser downloading html files

Haven’t used nginx in few years and trying to get it into production.

i’m having what will probably be a silly misconfiguration to most. I’m
running nginx
CentOS 7
with PHP-fpm

When I hit every PHP link on this site it generates some html and my
browser downloads it. I used the winginx .htaccess converter to create
rewrite rules.

Any direction would be great


Here is my config:

server {

listen 80;

server_name *;

root /var/www/;

index index.php;

error_page  404              /404.html;

# redirect server error pages to the static page /50x.html


error_page   500 502 503 504  /50x.html;

location = /50x.html {

    root   /usr/share/nginx/html;


# pass the PHP scripts to FastCGI server listening on


location ~ \.php$ {

    root           html;


    fastcgi_intercept_errors on;

    fastcgi_index  index.php;

    fastcgi_param  SCRIPT_FILENAME  /var/www/$fastcgi_script_name;

    include        fastcgi_params;


# deny access to .htaccess files, if Apache's document root

# concurs with nginx's one


location ~ /\.ht {

    deny  all;


autoindex off;

location / {

  autoindex off;

  rewrite ^/([^/]*)/([^/]*)/([^/]*)\.html$

/item.php?parentcategorie=$1&categorie=$2&fx=$3 break;

  rewrite ^/([^/]*)/$ /cat.php?parentcategorie=$1 break;

  rewrite ^/([^/]*)/([^/]*)/$

/subcat.php?parentcategorie=$1&categorie=$2 break;

  rewrite ^/([^/]*)/([^/]*)/([^/]*)/([^/]*)\.html$

/page.php?parentcategorie=$1&categorie=$2&fx=$3&img=$4 break;

  try_files $uri $uri/ =404;