# This setting to make Nginx use HTTP2 and Rate Limit
# Set global rate limiting log level
limit_req_log_level warn;
# Create a shared memory zone for rate limiting
limit_req_zone $binary_remote_addr zone=global:10m rate=10r/s;
# Server block for the main domain
server {| package com.github.thomasdarimont.keycloakx.custom.security; | |
| import io.netty.handler.ipfilter.IpFilterRuleType; | |
| import io.netty.handler.ipfilter.IpSubnetFilterRule; | |
| import io.vertx.core.http.HttpServerRequest; | |
| import lombok.Data; | |
| import lombok.extern.jbosslog.JBossLog; | |
| import org.keycloak.quarkus.runtime.configuration.Configuration; | |
| import javax.ws.rs.ForbiddenException; |
This is a short and simple example on how to build a proper Keycloak cluster, using DNS_PING as discovery protocol and an NGINX server as reverse proxy.
If you prefer to use JDBC_PING, see @xgp's example gist here: https://gist.github.com/xgp/768eea11f92806b9c83f95902f7f8f80
Please see also my video about Keycloak Clustering: http://www.youtube.com/watch?v=P96VQkBBNxU
NOTE: The video covers JDBC_PING protocol and uses the legacy Keycloak Wildfly distribution!
| DELIMITER ; | |
| DROP FUNCTION IF EXISTS urlencode; | |
| DELIMITER | | |
| CREATE FUNCTION URLENCODE(str VARCHAR(4096) CHARSET utf8) RETURNS VARCHAR(4096) CHARSET utf8 | |
| DETERMINISTIC | |
| CONTAINS SQL | |
| BEGIN |
All rules and guidelines in this document apply to HTML files.
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
Icon Legend:
· Space, ⇥ Tab, ↵ Enter/Return
| # BEGIN WordPress | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| # Prevent requests to index.php from being rewritten | |
| RewriteRule ^index\.php$ - [L] | |
| # Prefix specified PHP files with 'wordpress' | |
| RewriteRule ^((wp-login|xmlrpc)\.php) wordpress/$1 [R=301,L] |
All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
Most sections are broken up into two parts:
- Overview of all rules with a quick example
- Each rule called out with examples of do's and don'ts
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |