立即學習:https://edu.csdn.net/course/play/27216/358414?utm_source=blogtoedu
安全配置:
1.版本安全:ngix.conf中的http模塊中增加
server_tokens off;
2.IP安全:在location進行白名單和黑名單設置。
白名單: allow
黑名單:deny
3.文件安全:展示某目錄下的信息。
a.設置對應的目錄,增加:
autoindex on;
root /xxx/xxx;
b.設置匹配文件的正則表達式,用於設置展示的內容,增加:
add_header Content-Type text/plain;
root /xxx/xxx;
4.連接安全:https開啓