|
@@ -18,6 +18,21 @@ http {
|
|
types_hash_max_size 2048;
|
|
types_hash_max_size 2048;
|
|
server_tokens off; # 隐藏版本号
|
|
server_tokens off; # 隐藏版本号
|
|
|
|
|
|
|
|
+ # 性能优化配置
|
|
|
|
+ client_max_body_size 20m;
|
|
|
|
+ client_body_buffer_size 128k;
|
|
|
|
+ proxy_buffer_size 4k;
|
|
|
|
+ proxy_buffers 4 32k;
|
|
|
|
+ proxy_busy_buffers_size 64k;
|
|
|
|
+
|
|
|
|
+ # 全局 gzip 配置
|
|
|
|
+ gzip on;
|
|
|
|
+ gzip_vary on;
|
|
|
|
+ gzip_min_length 10240;
|
|
|
|
+ gzip_proxied expired no-cache no-store private auth;
|
|
|
|
+ gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml application/javascript;
|
|
|
|
+ gzip_disable "MSIE [1-6]\.";
|
|
|
|
+
|
|
# 日志配置优化
|
|
# 日志配置优化
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
'$status $body_bytes_sent "$http_referer" '
|
|
'$status $body_bytes_sent "$http_referer" '
|
|
@@ -48,28 +63,36 @@ http {
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
|
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
|
add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always;
|
|
add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always;
|
|
|
|
+ add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
|
|
|
+ add_header Permissions-Policy "geolocation=(), microphone=(), camera=()" always;
|
|
|
|
+
|
|
|
|
+ # 错误页面配置
|
|
|
|
+ error_page 404 /404.html;
|
|
|
|
+ error_page 500 502 503 504 /50x.html;
|
|
|
|
|
|
# Element2 子域名配置
|
|
# Element2 子域名配置
|
|
server {
|
|
server {
|
|
listen 80;
|
|
listen 80;
|
|
server_name element2.hht.test;
|
|
server_name element2.hht.test;
|
|
|
|
|
|
- # 开启gzip压缩
|
|
|
|
- gzip on;
|
|
|
|
- gzip_vary on;
|
|
|
|
- gzip_min_length 10240;
|
|
|
|
- gzip_proxied expired no-cache no-store private auth;
|
|
|
|
- gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml application/javascript;
|
|
|
|
- gzip_disable "MSIE [1-6]\.";
|
|
|
|
|
|
+ access_log /var/log/nginx/element2.access.log main;
|
|
|
|
+ error_log /var/log/nginx/element2.error.log warn;
|
|
|
|
|
|
location / {
|
|
location / {
|
|
root /usr/share/nginx/html/element2;
|
|
root /usr/share/nginx/html/element2;
|
|
index index.html index.htm;
|
|
index index.html index.htm;
|
|
try_files $uri $uri/ /index.html;
|
|
try_files $uri $uri/ /index.html;
|
|
|
|
|
|
- # 缓存控制
|
|
|
|
- expires 1h;
|
|
|
|
- add_header Cache-Control "public, no-transform";
|
|
|
|
|
|
+ # 针对不同类型的文件设置不同的缓存时间
|
|
|
|
+ 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-Origin' $cors_origin always;
|
|
@@ -78,28 +101,360 @@ http {
|
|
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
|
|
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
# Vue2 子域名配置
|
|
# Vue2 子域名配置
|
|
server {
|
|
server {
|
|
listen 80;
|
|
listen 80;
|
|
server_name vue2.hht.test;
|
|
server_name vue2.hht.test;
|
|
|
|
|
|
- # 开启gzip压缩
|
|
|
|
- gzip on;
|
|
|
|
- gzip_vary on;
|
|
|
|
- gzip_min_length 10240;
|
|
|
|
- gzip_proxied expired no-cache no-store private auth;
|
|
|
|
- gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml application/javascript;
|
|
|
|
- gzip_disable "MSIE [1-6]\.";
|
|
|
|
|
|
+ access_log /var/log/nginx/vue2.access.log main;
|
|
|
|
+ error_log /var/log/nginx/vue2.error.log warn;
|
|
|
|
|
|
location / {
|
|
location / {
|
|
alias /usr/share/nginx/html/v2.cn.vuejs.org/;
|
|
alias /usr/share/nginx/html/v2.cn.vuejs.org/;
|
|
index index.html index.htm;
|
|
index index.html index.htm;
|
|
try_files $uri $uri/ /index.html;
|
|
try_files $uri $uri/ /index.html;
|
|
|
|
|
|
- # 缓存控制
|
|
|
|
- expires 1h;
|
|
|
|
|
|
+ # 针对不同类型的文件设置不同的缓存时间
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # Vant 子域名配置
|
|
|
|
+ server {
|
|
|
|
+ listen 80;
|
|
|
|
+ server_name vant.hht.test;
|
|
|
|
+
|
|
|
|
+ access_log /var/log/nginx/vant.access.log main;
|
|
|
|
+ error_log /var/log/nginx/vant.error.log warn;
|
|
|
|
+
|
|
|
|
+ location / {
|
|
|
|
+ alias /usr/share/nginx/html/vant/;
|
|
|
|
+ index index.html index.htm;
|
|
|
|
+ try_files $uri $uri/ /index.html;
|
|
|
|
+
|
|
|
|
+ # 针对不同类型的文件设置不同的缓存时间
|
|
|
|
+ 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 /vant/ {
|
|
|
|
+ alias /usr/share/nginx/html/vant/;
|
|
|
|
+ try_files $uri $uri/ /tparking/index.html;
|
|
|
|
+ index index.html;
|
|
|
|
+ # 跨域支持
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # Vue3 子域名配置
|
|
|
|
+ server {
|
|
|
|
+ listen 80;
|
|
|
|
+ listen 8877; # 添加 8877 端口监听
|
|
|
|
+ server_name vue3.hht.test;
|
|
|
|
+
|
|
|
|
+ # 日志配置
|
|
|
|
+ access_log /var/log/nginx/vue3.access.log main buffer=32k flush=5s;
|
|
|
|
+ error_log /var/log/nginx/vue3.error.log warn;
|
|
|
|
+
|
|
|
|
+ # 安全相关配置
|
|
|
|
+ add_header X-Frame-Options "SAMEORIGIN" always;
|
|
|
|
+ add_header X-XSS-Protection "1; mode=block" always;
|
|
|
|
+ add_header X-Content-Type-Options "nosniff" always;
|
|
|
|
+
|
|
|
|
+ # 性能优化
|
|
|
|
+ client_max_body_size 10m;
|
|
|
|
+ client_body_timeout 12;
|
|
|
|
+ client_header_timeout 12;
|
|
|
|
+ keepalive_timeout 15;
|
|
|
|
+ send_timeout 10;
|
|
|
|
+
|
|
|
|
+ # 字体文件 MIME 类型
|
|
|
|
+ include /etc/nginx/mime.types;
|
|
|
|
+ types {
|
|
|
|
+ font/woff2 woff2;
|
|
|
|
+ font/woff woff;
|
|
|
|
+ font/ttf ttf;
|
|
|
|
+ font/eot eot;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ location / {
|
|
|
|
+ alias /usr/share/nginx/html/docs-zh-cn/.vitepress/dist/;
|
|
|
|
+ index index.html index.htm;
|
|
|
|
+ try_files $uri $uri/ /index.html;
|
|
|
|
+
|
|
|
|
+ # 针对不同类型的文件设置不同的缓存时间
|
|
|
|
+ location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
|
|
|
|
+ expires 7d;
|
|
|
|
+ add_header Cache-Control "public, no-transform";
|
|
|
|
+ access_log off;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ location ~* \.(html|htm)$ {
|
|
|
|
+ expires 1h;
|
|
|
|
+ add_header Cache-Control "public, no-transform";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # 禁止访问隐藏文件
|
|
|
|
+ location ~ /\. {
|
|
|
|
+ deny all;
|
|
|
|
+ access_log off;
|
|
|
|
+ log_not_found off;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # 禁止访问 .git 目录
|
|
|
|
+ location ~ /\.git {
|
|
|
|
+ deny all;
|
|
|
|
+ access_log off;
|
|
|
|
+ log_not_found off;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # 静态资源缓存优化
|
|
|
|
+ location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
|
|
+ root /usr/share/nginx/html/docs-zh-cn/.vitepress/dist;
|
|
|
|
+ expires 7d;
|
|
|
|
+ add_header Cache-Control "public, no-transform";
|
|
|
|
+ access_log off;
|
|
|
|
+ tcp_nodelay off;
|
|
|
|
+ open_file_cache max=1000 inactive=20s;
|
|
|
|
+ open_file_cache_valid 30s;
|
|
|
|
+ open_file_cache_min_uses 2;
|
|
|
|
+ open_file_cache_errors on;
|
|
|
|
+ try_files $uri =404;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # 错误页面配置
|
|
|
|
+ error_page 404 /404.html;
|
|
|
|
+ error_page 500 502 503 504 /50x.html;
|
|
|
|
+ location = /404.html {
|
|
|
|
+ internal;
|
|
|
|
+ }
|
|
|
|
+ location = /50x.html {
|
|
|
|
+ internal;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # 2x ant-design 子域名配置
|
|
|
|
+ server {
|
|
|
|
+ listen 80;
|
|
|
|
+ server_name 2x-ant-design.hht.test;
|
|
|
|
+
|
|
|
|
+ access_log /var/log/nginx/2x-ant-design.access.log main;
|
|
|
|
+ error_log /var/log/nginx/2x-ant-design.error.log warn;
|
|
|
|
+
|
|
|
|
+ location / {
|
|
|
|
+ root /usr/share/nginx/html/2x.ant.design;
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # 3x ant-design 子域名配置
|
|
|
|
+ server {
|
|
|
|
+ listen 80;
|
|
|
|
+ server_name 3x-ant-design.hht.test;
|
|
|
|
+
|
|
|
|
+ access_log /var/log/nginx/3x-ant-design.access.log main;
|
|
|
|
+ error_log /var/log/nginx/3x-ant-design.error.log warn;
|
|
|
|
+
|
|
|
|
+ location / {
|
|
|
|
+ root /usr/share/nginx/html/3x.ant.design;
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # 4x ant-design 子域名配置
|
|
|
|
+ server {
|
|
|
|
+ listen 80;
|
|
|
|
+ server_name 4x-ant-design.hht.test;
|
|
|
|
+
|
|
|
|
+ # 日志配置
|
|
|
|
+ access_log /var/log/nginx/4x-ant-design.access.log main buffer=32k flush=5s;
|
|
|
|
+ error_log /var/log/nginx/4x-ant-design.error.log warn;
|
|
|
|
+
|
|
|
|
+ # 安全相关配置
|
|
|
|
+ add_header X-Frame-Options "SAMEORIGIN" always;
|
|
|
|
+ add_header X-XSS-Protection "1; mode=block" always;
|
|
|
|
+ add_header X-Content-Type-Options "nosniff" always;
|
|
|
|
+
|
|
|
|
+ # 性能优化
|
|
|
|
+ client_max_body_size 10m;
|
|
|
|
+ client_body_timeout 12;
|
|
|
|
+ client_header_timeout 12;
|
|
|
|
+ keepalive_timeout 15;
|
|
|
|
+ send_timeout 10;
|
|
|
|
+
|
|
|
|
+ # 字体文件 MIME 类型
|
|
|
|
+ include /etc/nginx/mime.types;
|
|
|
|
+ types {
|
|
|
|
+ font/woff2 woff2;
|
|
|
|
+ font/woff woff;
|
|
|
|
+ font/ttf ttf;
|
|
|
|
+ font/eot eot;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ location / {
|
|
|
|
+ root /usr/share/nginx/html/4x.ant.design;
|
|
|
|
+ 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";
|
|
|
|
+ access_log off;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ location ~* \.(html|htm)$ {
|
|
|
|
+ expires 1h;
|
|
|
|
+ add_header Cache-Control "public, no-transform";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # 禁止访问隐藏文件
|
|
|
|
+ location ~ /\. {
|
|
|
|
+ deny all;
|
|
|
|
+ access_log off;
|
|
|
|
+ log_not_found off;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # 禁止访问 .git 目录
|
|
|
|
+ location ~ /\.git {
|
|
|
|
+ deny all;
|
|
|
|
+ access_log off;
|
|
|
|
+ log_not_found off;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # 跨域支持
|
|
|
|
+ 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 ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
|
|
+ root /usr/share/nginx/html/4x-ant-design;
|
|
|
|
+ expires 7d;
|
|
add_header Cache-Control "public, no-transform";
|
|
add_header Cache-Control "public, no-transform";
|
|
|
|
+ access_log off;
|
|
|
|
+ tcp_nodelay off;
|
|
|
|
+ open_file_cache max=1000 inactive=20s;
|
|
|
|
+ open_file_cache_valid 30s;
|
|
|
|
+ open_file_cache_min_uses 2;
|
|
|
|
+ open_file_cache_errors on;
|
|
|
|
+ try_files $uri =404;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ location @router {
|
|
|
|
+ rewrite ^.*$ /index.html last;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # 错误页面配置
|
|
|
|
+ error_page 404 /404.html;
|
|
|
|
+ error_page 500 502 503 504 /50x.html;
|
|
|
|
+ location = /404.html {
|
|
|
|
+ internal;
|
|
|
|
+ }
|
|
|
|
+ location = /50x.html {
|
|
|
|
+ internal;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # ant-design 子域名配置
|
|
|
|
+ server {
|
|
|
|
+ listen 80;
|
|
|
|
+ server_name ant-design.hht.test;
|
|
|
|
+
|
|
|
|
+ access_log /var/log/nginx/ant-design.access.log main;
|
|
|
|
+ error_log /var/log/nginx/ant-design.error.log warn;
|
|
|
|
+
|
|
|
|
+ location / {
|
|
|
|
+ root /usr/share/nginx/html/ant-design;
|
|
|
|
+ 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-Origin' $cors_origin always;
|
|
@@ -107,6 +462,33 @@ http {
|
|
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-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;
|
|
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
|
|
}
|
|
}
|
|
|
|
+ location @router {
|
|
|
|
+ rewrite ^.*$ /index.html last;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ # better-scroll 子域名配置
|
|
|
|
+ server {
|
|
|
|
+ listen 80;
|
|
|
|
+ server_name better-scroll-docs.hht.test;
|
|
|
|
+
|
|
|
|
+ location / {
|
|
|
|
+ #root /Users/sysadmin/code/vue_project/better-scroll-docs/zh-CN;
|
|
|
|
+ #index index.html index.htm;
|
|
|
|
+
|
|
|
|
+ alias /usr/share/nginx/html/better-scroll-docs/zh-CN/;
|
|
|
|
+ try_files $uri $uri/ /index.html;
|
|
|
|
+ index index.html;
|
|
|
|
+ add_header Access-Control-Allow-Origin *;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ location /docs/ {
|
|
|
|
+ alias /usr/share/nginx/html/better-scroll-docs/;
|
|
|
|
+ #try_files $uri $uri/ /tparking/index.html;
|
|
|
|
+ #index index.html;
|
|
|
|
+ #add_header Access-Control-Allow-Origin *;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
# 默认服务器配置
|
|
# 默认服务器配置
|