gavinray
Member level 1
Nginx Proxy Manager is a reverse proxy management tool based on Nginx, providing a user-friendly web interface to easily manage and configure Nginx reverse proxies. Its main features include:
Cloudflare is a company that provides web security and performance optimization services. Its main products include Content Delivery Network (CDN), DDoS protection, website acceleration, DNS (Domain Name System) services, and Web Application Firewall (WAF), among others.
By using Cloudflare's services, websites can achieve:
- User-friendly interface: Quickly add and manage proxy hosts (reverse proxy rules) through the graphical interface.
- SSL Management: Supports automatic SSL/TLS certificate issuance and renewal via Let's Encrypt to secure your website.
- Access Control: Set access control rules for proxy hosts, such as restricting access by specific IP addresses or requiring basic authentication.
- HTTP Proxy and WebSocket Support: Supports regular HTTP proxying as well as WebSocket proxying.
- Simple Docker Deployment: Easy to deploy Nginx Proxy Manager using Docker.
- Multi-domain Support: Manage multiple domains and hosts within the same instance.
Cloudflare is a company that provides web security and performance optimization services. Its main products include Content Delivery Network (CDN), DDoS protection, website acceleration, DNS (Domain Name System) services, and Web Application Firewall (WAF), among others.
By using Cloudflare's services, websites can achieve:
- Faster Loading Speeds: Cache website content at Cloudflare’s global CDN nodes, reducing load times by serving content from servers closer to the user.
- Improved Security: Provide DDoS protection to defend against large-scale traffic attacks, safeguarding websites from malicious threats.
- Better Reliability: Increase website availability and performance via intelligent routing and load balancing.
- Easy Management: Provides a user-friendly interface and API for convenient management and configuration.
Prerequisites
- Operating System: Suitable for all Docker-supported operating systems, such as Ubuntu, CentOS, Debian, etc., with Nginx Proxy Manager installed correctly.
- Nginx Proxy Manager Version: It’s recommended to use the latest version to ensure compatibility and security.
- Cloudflare Account: A valid Cloudflare account with at least one domain added.
- Network Environment: Ensure that the server can access the internet for communication with Cloudflare’s API.
Relevant Links:
- Cloudflare Official Website: https://www.cloudflare.com
- Cloudflare API Token Application: https://dash.cloudflare.com/profile/api-tokens
- Nginx Proxy Manager Official Documentation: https://nginxproxymanager.com/
- Cloudflare Official Documentation: https://developers.cloudflare.com/
How to Apply for Cloudflare API Token
- Go to the API Token Application Page
Open the following URL: https://dash.cloudflare.com/profile/api-tokens or access the API section within any domain page.
- Create the Token
You can either use a template or create your own token.- Permissions: Select "DNS" as the permission.
- Zone: Choose "All Zones".For added security, you can set a specific client IP address.
- Confirm Information
Ensure that all information is correct, then create the token. - Save the Token
After successful creation, the token will be displayed.
Important: Tokens are shown only once, so make sure to save it securely.
Setting Up Wildcard Domain Proxy in Nginx Proxy Manager
- Log into Nginx Proxy Manager
Access the Nginx Proxy Manager dashboard. - Add a New Wildcard Domain Certificate
In the certificate application section, add a new wildcard domain certificate. - Fill in Domain Information
- Domain: Enter the wildcard domain you wish to apply for.
- Email Address: Use your Cloudflare account’s email address.
- DNS Provider: Select "Cloudflare".
- Enter Credentials
After selecting Cloudflare as the DNS provider, the credentials will auto-fill. Replace the value of dns_cloudflare_api_token with the API token you just generated.
Example: