|
@@ -466,6 +466,41 @@ http {
|
|
|
rewrite ^.*$ /index.html last;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ # ant-design-vue 子域名配置
|
|
|
+ server {
|
|
|
+ listen 80;
|
|
|
+ server_name ant-design-vue.hht.test;
|
|
|
+
|
|
|
+ access_log /var/log/nginx/ant-design-vue.access.log main;
|
|
|
+ error_log /var/log/nginx/ant-design-vue.error.log warn;
|
|
|
+
|
|
|
+ location / {
|
|
|
+ root /usr/share/nginx/html/ant-design-vue;
|
|
|
+ index index.html index.htm;
|
|
|
+ try_files $uri $uri/ @router;
|
|
|
+
|
|
|
+ # 针对不同类型的文件设置不同的缓存时间
|
|
|
+ location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
|
|
|
+ expires 7d;
|
|
|
+ add_header Cache-Control "public, no-transform";
|
|
|
+ }
|
|
|
+
|
|
|
+ location ~* \.(html|htm)$ {
|
|
|
+ expires 1h;
|
|
|
+ add_header Cache-Control "public, no-transform";
|
|
|
+ }
|
|
|
+
|
|
|
+ # 跨域支持
|
|
|
+ add_header 'Access-Control-Allow-Origin' $cors_origin always;
|
|
|
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
|
|
+ add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
|
|
|
+ add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
|
|
|
+ }
|
|
|
+ location @router {
|
|
|
+ rewrite ^.*$ /index.html last;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
# better-scroll 子域名配置
|
|
|
server {
|