Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Configure NginX for Keycloak on OS X

Attila Levente EGYEDI edited this page Mar 9, 2016 · 5 revisions

Backup the existing Nginx configuration:

cp $NGINX_HOME/nginx.conf $NGINX_HOME/nginx.conf.backup

Edit the configuration file:

sudo vi $NGINX_HOME/nginx.conf

Add the content below before the existing server block:

proxy_http_version 1.1; # this is essential for chunked responses to work
proxy_buffering    off;
proxy_set_header   X-Real-IP $remote_addr;
proxy_set_header   X-Scheme $scheme;
proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header   Host $http_host;

upstream cedar-backend-auth-http {
  server 127.0.0.1:8080;
}

server {
  listen              80;
  server_name         auth.metadatacenter.orgx;
  location / {
      proxy_pass http://cedar-backend-auth-http;
  }
}

If Nginx is running, stop it:

sudo nginx -s stop 

Then restart it:

sudo nginx
Clone this wiki locally