bismillah …
secara default ojs menyediakan config dengan model sertifikat ssl di pasang langsung di server , jika kita akan menggunakan basis reverse proxy , di saya menggunakan haproxy ( bisa make nginx dll ) , maka ada beberapa hal yang perlu di setup lagi
- Sisi ha proxy
di bagian frontend saya pasang aturan force redirect 301 ke https
frontend front_default
bind *:80
bind *:443 ssl crt /etc/haproxy/ssl alpn h2,http/2
#bind *:443 ssl crt /etc/haproxy/ssl
http-request set-var(txn.path) path
http-response set-header Cache-Control public,\ max-age=2592000 if { var(txn.path) -m end .svg .ico .jpg .png .jpeg .gif .css .js .woff2 .ttf .webp }
redirect scheme https code 301 if { hdr(Host) -i diktren.stiq.assyifa.ac.id } !{ ssl_fc }
rule di atas akan menggantikan force ssl On; di sisi config ojs
sisa nya aturan backend dan acl bisa seperti config haproxy biasa, sertifikat ssl sudah tersedia di folder
/etc/haproxy/ssl
- Sisi OJS
di sisi OJS buka file config.inc.php
base url di update ganti ke https
; The canonical URL to the OJS installation (excluding the trailing slash)
base_url = "https://diktren.stiq.assyifa.ac.id"
matikan force_ssl , force_login_ssl dan session_check_ip
[security]
; Force SSL connections site-wide and also sets the "Secure" flag for session cookies
; See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#secure
force_ssl = Off
; Force SSL connections for login only
force_login_ssl = Off
; This check will invalidate a session if the user's IP address changes.
; Enabling this option provides some amount of additional security, but may
; cause problems for users behind a proxy farm (e.g., AOL).
session_check_ip = Off
force_ssl redirect trafik ke ssl sudah di gantikan oleh haproxy
save , kemudian bagian penting nya di ojs 3.3.0.11 , ada error untuk css , js dll masih di load dengan http sehingga tidak dapat di load ( karena mix https http ) , solusi nya kita butuh edit manual file /journal/lib/pkp/classes/core/PKPRequest.inc.php

function getProtocol() {
if (!isset($this->_protocol)) {
$this->_protocol = (!isset($_SERVER['HTTPS']) || strtolower_codesafe($_SERVER['HTTPS']) != 'on') ? 'https' : 'https';
HookRegistry::call('Request::getProtocol', array(&$this->_protocol));
}
return $this->_protocol;
}
ganti ‘http’ : ‘https’ menjadi ‘http’ : ‘https’ , save kemudian tes
kemudian bisa juga coba clear ojs cache jika masih belum di load dengan benar
root@jurnal-diktren-222:/var/www/html/journal# cd /var/www/html/journal
root@jurnal-diktren-222:/var/www/html/journal# rm -rf *_cache
semoga bermanfaat 🙂
referensi :