keycloak apache server configuration with 'Mixed Content' problems

纵饮孤独 提交于 2019-11-30 04:57:54

问题


have a problems configuring keycloak behind my apache server,

Mixed Content: The page at 'https://dev.mydomain.com/auth/admin/master/console/' was loaded over HTTPS, but requested an insecure script 'http://dev.mydomain.com/auth/resources/1.7.0.final/admin/keycloak/js/controllers/groups.js'. This request has been blocked; the content must be served over HTTPS.

My apache configuration is,

ServerName dev.mydomain.com 
ServerAdmin dev@mydomain.com



SSLEngine on
SSLCertificateFile /opt/mydomain/domains/dev.mydomain.com/apache/dev.mydomain.com.crt 
SSLCertificateKeyFile /opt/mydomain/domains/dev.mydomain.com/apache/dev.mydomain.com.key 
SSLCertificateChainFile /opt/mydomain/domains/dev.mydomain.com/apache/dev.mydomain.com.ca-bundle


DocumentRoot /opt/mydomain/domains/dev.mydomain.com/apache/htdocs

<Directory /opt/mydomain/domains/dev.mydomain.com/apache/htdocs>
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
    Require all granted
</Directory>

ProxyRequests Off

ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"

<Proxy  https://dev.mydomain.com/*  >
   Order deny,allow
   Deny from all
   Allow from all
 </Proxy>



ProxyPass /auth http://localhost:10082/auth nocanon
ProxyPassReverse /auth http://localhost:10082/auth

Any idea what's wrong?


回答1:


You'll also need to update Wildfly configuration as outlined in Enable SSL on a Reverse Proxy -> Configure WildFly

If you look for a Wildfly CLI configuration, have a look here:

$ jboss-cli.sh -standalone --file=batch.cli

# batch.cli
embed-server --std-out=echo
batch
/subsystem=undertow/server=default-server/http-listener=default:write-attribute(name=proxy-address-forwarding,value=true)
/subsystem=undertow/server=default-server/http-listener=default:write-attribute(name=redirect-socket,value=proxy-https)
/socket-binding-group=standard-sockets/socket-binding=proxy-https:add(port=443)
run-batch
stop-embedded-server


来源:https://stackoverflow.com/questions/35169503/keycloak-apache-server-configuration-with-mixed-content-problems

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!