This repository provides a complete setup for integrating OAuth2 proxy with Nginx to secure web applications and services using OAuth 2.0 authentication.
- Secure authentication using OAuth2
- Nginx reverse proxy configuration
- Support for multiple OAuth providers
- Easy configuration and deployment
- Docker
- Docker Compose
- OAuth2 provider credentials (Google, GitHub, etc.)
Configure the following environment variables in .env
:
OAUTH2_PROXY_CLIENT_ID
: OAuth provider client IDOAUTH2_PROXY_CLIENT_SECRET
: OAuth provider client secretOAUTH2_PROXY_COOKIE_SECRET
: Random secret for cookie encryptionOAUTH2_PROVIDER
: Authentication provider (google, github, etc.)
- GitHub
- Azure AD
- Custom OpenID Connect providers
-
Clone the repository:
git clone https://github.com/tharinduRE/oauth2-proxy-nginx.git cd oauth2-proxy-nginx
-
Create
.env
file with your configuration -
Start the services:
docker-compose up -d
Access your secured application through https://yourdomain.com
- Always use HTTPS
- Rotate OAuth tokens and secrets regularly
- Limit access using email domains or specific users
- Check Docker logs:
docker-compose logs
- Verify environment variables
- Ensure correct OAuth provider configuration
- Fork the repository
- Create a feature branch
- Commit your changes
- Push and create a Pull Request
[Specify License - e.g., MIT]
[Maintainer Contact Information]