The solution involves separating user access from automated system integrations. A new IIS web publication was created specifically for employees, while the existing IIS remains dedicated to external integrations, restricted by IP allowlists.

Nginx acts as the external HTTPS gateway and reverse proxy. It works in conjunction with oauth2-proxy to manage OIDC interactions with Keycloak, which handles centralized authentication via Active Directory and enforces MFA policies, such as TOTP.

When a user accesses the web publication, Nginx checks for an active session. If none exists, the user is redirected to Keycloak for authentication. Upon successful verification, Nginx grants access to the IIS server, while maintaining the original 1C authentication layer.

Access control is managed by linking Keycloak to a specific Active Directory group. This setup allows for centralized user management, where adding or removing members from the group updates access permissions across the gateway.