昔のメモを見忘れて、謎に格闘してしまった。
https://firemio.blogspot.com/2016/10/centos72lamp_11.html
server {
listen 80;
server_name mydomain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
root /var/www/mydomain.com;
index index.php index.html;
server_name mydomain.com;
ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;
try_files $uri $uri/ /index.php$is_args$args;
location / {
try_files $uri $uri?$args $uri/ /index.php?$uri&$args /index.php?$args;
}
location ~* \.php(/|$) {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
0 件のコメント:
コメントを投稿