1. My Caddy version (caddy -version
):
v2.0.0-beta11
2. How I run Caddy:
./caddy run --config myConfig.json
a. System environment:
OS, relevant versions, systemd? docker? etc.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial
d. My complete Caddyfile:
{
"admin": {
"listen": ":2019"
},
"apps": {
"http": {
"servers": {
"reverse_proxy_master": {
"listen": ["0.0.0.0:443"],
"@id" : "reverse_proxy_master",
"routes": [
],
"experimental_http3": false
}
}
},
"tls": {
"automation": {
"policies": [
{
"hosts": [],
"management": {
"ca": "https://acme-staging-v02.api.letsencrypt.org/directory",
"module": "acme"
}
}
]
}
}
}
}
Route Handlers:
{
"@id":"example.com",
"handle":[
{
"handler":"subroute",
"routes":[
{
"handle":[
{
"handler":"reverse_proxy",
"headers":{
"request":{
"set":{
"Host":[
"{http.request.host}"
],
"X-Forwarded-For":[
"{http.request.remote}"
],
"X-Forwarded-Port":[
"{http.request.port}"
],
"X-Forwarded-Proto":[
"{http.request.scheme}"
],
"X-Real-Ip":[
"{http.request.remote}"
]
}
}
},
"upstreams":[
{
"dial":"<ip>"
}
]
}
],
"match":[
{
"path":[
"/"
]
}
]
}
]
}
],
"match":[
{
"host":[
"example.com"
]
}
],
"terminal":false
}
3. The problem I’m having:
Have wordpress site. I have setup A record to point to my caddy server and do reverse proxy with auto ssl certificate generation. This thing is working, however post reverse proxy main domain URL is https however rest part of site is broken as static resources like css etc are on loaded.
4. Error messages and/or full log output:
No error in caddy but Chrome console shows following error:
(index):13 Mixed Content: The page at 'https://example.com/' was loaded over HTTPS, but requested an insecure script 'http://example.com/wp-includes/js/wp-emoji-release.min.js?ver=5.2.2'. This request has been blocked; the content must be served over HTTPS.
f @ (index):13
(anonymous) @ (index):13
(anonymous) @ (index):13
(index):29 Mixed Content: The page at 'https://example.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://example.com/wp-includes/css/dist/block-library/style.min.css?ver=5.2.2'. This request has been blocked; the content must be served over HTTPS.
(index):30 Mixed Content: The page at 'https://example.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://example.com/wp-includes/css/dist/block-library/theme.min.css?ver=5.2.2'. This request has been blocked; the content must be served over HTTPS.
(index):31 Mixed Content: The page at 'https://example.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://example.com/wp-content/themes/twentynineteen/style.css?ver=1.4'. This request has been blocked; the content must be served over HTTPS.
(index):32 Mixed Content: The page at 'https://example.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://example.com/wp-content/themes/twentynineteen/print.css?ver=1.4'. This request has been blocked; the content must be served over HTTPS.
(index):88 Mixed Content: The page at 'https://example.com/' was loaded over a secure connection, but contains a form that targets an insecure endpoint 'http://example.com/'. This endpoint should be made available over a secure connection.
Please assist.