XWiki https mixed content (10.11 docker container behind nginx proxy) + REST Nightmare


Issue 1: Mixed Content: The page at ‘https://xwiki.mydomain.local/bin/view/Main/#Attachments’ was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ‘http://xwiki.mydomain.local/bin/view/Main/#Attachments’. This request has been blocked; the content must be served over HTTPS.

it occurs on attachment deletion, comment deletion, attachment upload, object deletion. maybe somewhere else.

Issue 2: REST Nigtmare. Rest API returns
<link href="http://xwiki.mydomain.local/rest/wikis/xwiki/spaces/Main/spaces/SPACENAME/spaces/SPACENAME2" rel="http://www.xwiki.org/rel/space"/>


How can I get rid of HTTP completely ? I suppose there is something to do with Tomcat, but everything is set as per documentation.

server {
listen 80;
server_name xwiki.mydomain.local;
rewrite ^ https://$server_name$request_uri? permanent;

access_log /var/log/nginx/xwiki-access.log;
error_log /var/log/nginx/xwiki-error.log;


server {
listen 443 ssl;
server_name xwiki.mydomain.local;
client_max_body_size 4500m;
ssl_certificate /etc/nginx/ssl/xwiki.mydomain.local.crt;
ssl_certificate_key /etc/nginx/ssl/xwiki.mydomain.local.key;
access_log /var/log/nginx/xwiki-access.log;
error_log /var/log/nginx/xwiki-error.log;

location / {
proxy_pass_request_headers on;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_read_timeout 600s;

xwiki.url.protocol=https is set.

<Engine name=“Catalina” defaultHost=“localhost”>
       <Valve className=“org.apache.catalina.valves.RemoteIpValve”

Hm… I’ve just realized that in my case Tomcat will never get requests from
In my case localhost_access_log shows “remote” ip which is host IP in the docker network…

Possibly I have to change Tomcat valve configuration to


1 Like


thank you for providing your settings and solution. I found it very helpful for setting up my own XWiki instance via Docker. I used this knowledge to automate the entire XWiki setup process and get rid of those details. Now all that’s required is running a script from my repository to deploy a LetsEncrypt certificate. Maybe it will be helpful for someone who is struggling with the same issues.

Best regards