1. You need to rewrite the 80 port to 443.
server {
listen 80;
server_name oa.dalu.com;
rewrite ^(.*)$ https://${server_name}$1 permanent;
}
server {
listen 443;
#server_name default;
server_name oa.dalu.com;
root /data/web/;
2. Whitelist configuration for Nginx domain access
server {
listen 80;
server_name www.test.com;
root /var/www/html/test;
access_log /var/www/logs/access.log main;
error_log /var/www/logs/error.log;
## Whitelist settings, only allow clients from the following three source IPs and local access to this site.
allow 100.110.15.16;
allow 100.110.15.17;
allow 100.110.15.18;
allow 127.0.0.1;
deny all;
}
———————-end———————
Recommended Reading
1. Practical – k8s Monitoring MySQL
2. Practical – Prometheus Monitoring Domain Certificate Expiration
3. Practical – Prometheus Monitoring MySQL
4. Practical – Prometheus Monitoring Redis
5.Nginx Implementing WAF Dynamic IP Blocking via Lua+Redis
6. Comprehensive Interpretation and Practical Exercises of Jenkins
7. E-commerce Project Kubernetes Deployment and Performance Optimization Practice
8. Essential Shell Scripts for Work (2)
9. Essential Shell Scripts for Work
10. Essential Shell Scripts for Work (3)
If this article has been helpful to you, please like, view, and share, this is very important for me to continue sharing and creating quality articles. Thank you 🙏🏻, if you need learning materials, please leave a private message!
Please like → light up “view” → share