Help HTTPS to bitnami wordpress (mixed content error, need to force-rewrite http to https)


(Orangpelupa) #1
  • explain what you are trying to do,
    I want bitnami wordpress to run over HTTPS thru caddy

  • show what you have already tried,
    sub.example.com {
    proxy / ipaddress:81 {
    transparent
    insecure_skip_verify
    except /map.xml /robots.txt
    }
    }

  • include error messages and log output,
    on chrome console: error mixed content. https page request http, request blocked.

so despite the website itself accessible from HTTPS, the layout etc are broken because it keeps requesting CSS etc from HTTP.

how to fix this? maybe i can tell caddy to force rewrite all http to https?

thankyou

EDIT

when i use

sub.example.com {
proxy / ipaddress:444 {
transparent
insecure_skip_verify
except /map.xml /robots.txt
}

chrome give error

Bad Request

Your browser sent a request that this server could not understand.
Reason: You’re speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

EDIT

this https://github.com/mholt/caddy/issues/1033

explains that wordpress doesnt correctly handle https (the last reply). it seems he then fixed the problem but didnt share the solution. bummer

EDIT

i installed HTTPS Redirection plugin, and tell it to force anything including static contents thru https.

now the website it works, but it still have broken mixed content because it still asks resources from external sites (e.g. GRAVATAR) thru http instead of HTTPS.

i think i really need to know how to force rewrite http to https thru caddy


(Orangpelupa) #2

SOLVED
simply install this wordpress plugn SSL Insecure Content Fixer