Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
commander-deploy
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpd
commander-deploy
Commits
638ae3fc
Commit
638ae3fc
authored
Oct 14, 2025
by
李辉02
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(将nginx挂载出来): web
parent
151c5a8b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
configmap.yaml
charts/commander-web/templates/configmap.yaml
+46
-0
deployment.yaml
charts/commander-web/templates/deployment.yaml
+8
-0
No files found.
charts/commander-web/templates/configmap.yaml
0 → 100644
View file @
638ae3fc
apiVersion
:
v1
kind
:
ConfigMap
metadata
:
name
:
{{
.Chart.Name
}}
-config
namespace
:
{{
.Values.global.app.namespace
}}
data
:
nginx.conf
:
|
server {
listen 80;
server_name localhost;
# 开启 gzip 压缩
gzip on;
gzip_min_length 1k;
gzip_comp_level 6;
gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
# 根目录配置
location / {
root /usr/share/nginx/html;
index index.html index.htm;
# 支持 SPA 单页应用,所有请求都返回 index.html
try_files $uri $uri/ /index.html;
}
# 静态资源缓存配置
location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
root /usr/share/nginx/html;
expires 7d;
add_header Cache-Control "public, immutable";
}
# 禁止访问 .htaccess 等隐藏文件
location ~ /\. {
deny all;
}
# 错误页面
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
charts/commander-web/templates/deployment.yaml
View file @
638ae3fc
...
...
@@ -26,3 +26,11 @@ spec:
name
:
http
resources
:
{{
- include "app.resources" . | nindent 12
}}
volumeMounts
:
-
name
:
nginx-config
mountPath
:
/etc/nginx/conf.d/default.conf
subPath
:
nginx.conf
volumes
:
-
name
:
nginx-config
configMap
:
name
:
{{
.Chart.Name
}}
-config
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment