NginxでのWordPress設定

LINEで送る
Pocket

server {
    listen       80;
    server_name  blog.adachin.me;
    rewrite index.html https://blog.adachin.me permanent;
}


server {
    listen       443;
    ssl on;
    server_name  blog.adachin.me;
    root /var/www/wordpress;
    index index.html index.php;
    access_log      /var/log/nginx/blog.adachin.me.ssl.access.log;
    error_log       /var/log/nginx/blog.adachin.me.ssl.error.log;
    ssl_certificate /etc/letsencrypt/live/blog.adachin.me/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/blog.adachin.me/privkey.pem;
    try_files $uri $uri/ /index.php?q=$uri&$args;

    location ~ \.php$ {
            fastcgi_pass  unix:/var/run/php/php7.0-fpm.sock;
            fastcgi_index   index.php;
            fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
            include        fastcgi_params;
    }
}

Was this helpful?

0 / 0

コメントを残す 0

Your email address will not be published. Required fields are marked *