This is my note howto setting WordPress

First add this at wp-config.php

define('FORCE_SSL_ADMIN', true);

if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false){
    $_SERVER['HTTPS'] = 'on';
    $_SERVER['SERVER_PORT'] = 443;

define('WP_HOME', 'https://domain name');
define('WP_SITEURL', 'https://domain name');

// add this at nginx site config

server {
    listen 443 ssl;
    server_name domain name;

    ssl_certificate /etc/letsencrypt/live/domain name/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/domain name/privkey.pem;

    access_log /var/log/domain name/logs/access.log;
    error_log /var/log/domain name/logs/error.log;

location / {
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;
            proxy_set_header X-Forwarded-Proto https;



Discover more from Susiloharjo

Subscribe now to keep reading and get access to the full archive.

Continue reading