Dies ist eine Einstellungsdatei, wenn Sie PHP, Python und Let's Encrypt mit Nginx verwenden.
Bestätigt unter Ubuntu 18.04.
Der Servername lautet example.com.
/etc/nginx/sites-available/default
#
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.php;
server_name _;
location / {
try_files $uri $uri/ =404;
}
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
#
location ~ \.py$ {
gzip off;
include fastcgi_params;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_index index.py;
fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
}
#
listen 443 ssl;
server_name example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
}
#