cyberark/secretless-broker

View on GitHub
demos/quick-start/docker/etc/nginx.conf

Summary

Maintainability
Test Coverage
user nginx;
worker_processes 1;

events {
  worker_connections 4;
}

http {
  server {
    listen 0.0.0.0:80;
    listen 0.0.0.0:8080;

    location / {
      auth_basic 'Authentication required';
      auth_basic_user_file /etc/nginx/.htpasswd;
      try_files success @authenticated;
    }

    location @authenticated {
      return 200 'You are successfully authenticated.';
    }

    error_page 401 /401;
    location /401 {
       return 401 'You are not authenticated.';
    }
  }
}