server {
listen 8800;
server_name localhost;
#underscores_in_headers on;
#charset koi8-r;
#access_log logs/host.access.log main;
root C:/cdn;
location / {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept";
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS,PUT,DELETE";
try_files $uri $uri/ @router;
index index.html index.htm;
}
location @router {
rewrite ^.*$ /index.html last;
}
}
server {
listen 80;
server_name www.cdn.rg1008.com cdn.rg1008.com;
rewrite ^(.*)$ https://$host$1 permanent;
}
server {
#SSL 访问端口号为 443
listen 443 ssl;
#填写绑定证书的域名
server_name www.cdn.rg1008.com cdn.rg1008.com;
#证书文件名称
ssl_certificate 1_www.cdn.rg1008.com_bundle.crt;
#私钥文件名称
ssl_certificate_key 2_www.cdn.rg1008.com.key;
ssl_session_timeout 5m;
#请按照以下协议配置
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
root C:/cdn;
location / {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept";
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS,PUT,DELETE";
try_files $uri $uri/ @router;
index index.html index.htm;
}
location @router {
rewrite ^.*$ /index.html last;
}
}
文档更新时间: 2021-06-26 08:00 作者:admin