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;
}
if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
    $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
}

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;
            proxy_pass http://10.80.1.2:6000;

    }

}

Discover more from Susiloharjo

Subscribe to get the latest posts sent to your email.

Discover more from Susiloharjo

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

Continue reading