add nginx.conf
This commit is contained in:
+17
-3
@@ -1,8 +1,18 @@
|
|||||||
|
# HTTP & HTTPS
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
|
listen 443 ssl;
|
||||||
server_name www.syoai.cn;
|
server_name www.syoai.cn;
|
||||||
|
|
||||||
root "D:/phpstudy_pro/WWW/h5/official-site-syoai";
|
ssl_certificate /etc/nginx/cert/www.syoai.cn.pem;
|
||||||
|
ssl_certificate_key /etc/nginx/cert/www.syoai.cn.key;
|
||||||
|
ssl_protocols TLSv1.2 TLSv1.3;
|
||||||
|
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5;
|
||||||
|
ssl_prefer_server_ciphers on;
|
||||||
|
ssl_session_cache shared:SSL:10m;
|
||||||
|
ssl_session_timeout 10m;
|
||||||
|
|
||||||
|
root /var/www/official-site-syoai;
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
@@ -15,6 +25,10 @@ server {
|
|||||||
add_header Cache-Control "public, no-transform";
|
add_header Cache-Control "public, no-transform";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 安全响应头
|
||||||
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
|
|
||||||
# 禁止访问隐藏文件
|
# 禁止访问隐藏文件
|
||||||
location ~ /\. {
|
location ~ /\. {
|
||||||
deny all;
|
deny all;
|
||||||
@@ -27,6 +41,6 @@ server {
|
|||||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
||||||
gzip_vary on;
|
gzip_vary on;
|
||||||
|
|
||||||
access_log logs/www.syoai.cn.access.log;
|
access_log /var/log/nginx/www.syoai.cn.access.log;
|
||||||
error_log logs/www.syoai.cn.error.log;
|
error_log /var/log/nginx/www.syoai.cn.error.log;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user