Ceci est un fichier de configuration lors de l'utilisation de PHP, Python, Let's Encrypt avec Nginx.
Confirmé sur Ubuntu 18.04.
Le nom du serveur est 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;
}
#
Recommended Posts