so, to start off with, yes, I have looked for a solution, but I can't find it. I know the issue is with my rewrite code, but I don't know enough to fix it. I'm using nginx and php-fpm on debian 9.5.
php loads just fine, but .html doesn't work anymore.
server {
# SSL configuration
#
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
root /var/www/example.com;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name example.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri.php;
rewrite ^(.*)$ $uri.php;
}
location /media {
autoindex on;
autoindex_exact_size off;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
# # With php-cgi (or other tcp sockets):
# #fastcgi_pass 127.0.0.1:9000;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
thanks for listening. I look forward to hearing back.
edit: just for clarification, my intention is for python files not to have the .php show in the url, but for html files to load normally.