Skip to content

Instantly share code, notes, and snippets.

@ijokarumawak
Created February 8, 2018 02:48
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save ijokarumawak/d14e5b28a16d363d6c001a92b7e73fe4 to your computer and use it in GitHub Desktop.
Save ijokarumawak/d14e5b28a16d363d6c001a92b7e73fe4 to your computer and use it in GitHub Desktop.
NGinx Apache NiFi Auth Example
worker_processes 1;
events { worker_connections 1024; }
http {
sendfile on;
upstream nifi {
server 192.168.99.1:8443;
}
# browser/API -> http -> NGINX -> https -> Secure NiFi
# Clients have to login with user/password
server {
listen 8080;
server_name nginx.local;
proxy_ssl_trusted_certificate /etc/nginx/nifi-cert.pem;
location / {
proxy_pass https://nifi;
proxy_set_header X-ProxyScheme https;
proxy_set_header X-ProxyHost nginx.local;
proxy_set_header X-ProxyPort 8443;
proxy_set_header X-ProxyContextPath /;
}
}
# browser/API -> https -> NGINX -> https -> Secure NiFi
# Clients have to login with user/password
server {
listen 8443 ssl;
server_name nginx.local;
ssl_certificate /etc/nginx/nginx.crt;
ssl_certificate_key /etc/nginx/nginx.key;
proxy_ssl_trusted_certificate /etc/nginx/nifi-cert.pem;
location / {
proxy_pass https://nifi;
proxy_set_header X-ProxyScheme https;
proxy_set_header X-ProxyHost nginx.local;
proxy_set_header X-ProxyPort 8443;
proxy_set_header X-ProxyContextPath /;
}
}
# browser/API -> https -> NGINX -> https -> Secure NiFi
# Clients login as nginx user with nginx.cert
server {
listen 8444 ssl;
server_name nginx.local;
ssl_certificate /etc/nginx/nginx.crt;
ssl_certificate_key /etc/nginx/nginx.key;
proxy_ssl_certificate /etc/nginx/nginx.crt;
proxy_ssl_certificate_key /etc/nginx/nginx.key;
proxy_ssl_trusted_certificate /etc/nginx/nifi-cert.pem;
location / {
proxy_pass https://nifi;
proxy_set_header X-ProxyScheme https;
proxy_set_header X-ProxyHost nginx.local;
proxy_set_header X-ProxyPort 8444;
proxy_set_header X-ProxyContextPath /;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment