1 Star 0 Fork 0

wxd_ops/k8s-demo-fe

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test.conf 1.69 KB
一键复制 编辑 原始数据 按行查看 历史
wxd_ops 提交于 2025-05-08 21:17 +08:00 . add test.conf.
server {
listen 7070;
server_name 192.168.56.102;
# CORS配置保持不变
set $cors_origin "*";
set $cors_cred "true";
set $cors_header "authToken,Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,X-Requested-With,app,time,sign,cityos-application-code";
set $cors_method "POST, GET,OPTIONS,PATCH,PUT";
if ($http_origin ~* (.*\.urban-computing.cn)) {
set $cors_origin $http_origin;
}
if ($http_origin ~* (.*\.ops.com)) {
set $cors_origin $http_origin;
}
if ($http_origin ~* (.*\.smarts-urban.cn)) {
set $cors_origin $http_origin;
}
if ($http_origin ~* (.*\.dev.com)) {
set $cors_origin $http_origin;
}
if ($request_filename ~* .*.(html|htm)$) {
set $cache "no-cache";
}
add_header Access-Control-Allow-Origin $cors_origin always;
add_header Access-Control-Allow-Credentials $cors_cred always;
add_header Access-Control-Allow-Headers $cors_header always;
add_header Access-Control-Allow-Methods $cors_method always;
add_header Cache-Control $cache;
if ($request_method = 'OPTIONS') {
return 200;
}
location / {
alias /export/fronted/k8s-demo-fe/;
try_files $uri $uri/ /index.html;
index index.html;
}
# 静态资源缓存设置
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
alias /export/fronted/k8s-demo-fe/;
expires 1y;
add_header Cache-Control "public, no-transform";
}
# 防止访问隐藏文件
location ~ /\. {
deny all;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wxd_ops/k8s-demo-fe.git
git@gitee.com:wxd_ops/k8s-demo-fe.git
wxd_ops
k8s-demo-fe
k8s-demo-fe
master

搜索帮助