re_create_config.sh
1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# 删除现有的 ConfigMap
kubectl delete configmap -n ecommerce frontend-config
# 重新创建包含所有必要键的 ConfigMap
kubectl create configmap -n ecommerce frontend-config \
--from-literal=nginx.conf="
events {
worker_connections 1024;
}
http {
client_body_temp_path /tmp/nginx-client-body;
proxy_temp_path /tmp/nginx-proxy;
fastcgi_temp_path /tmp/nginx-fastcgi;
uwsgi_temp_path /tmp/nginx-uwsgi;
scgi_temp_path /tmp/nginx-scgi;
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
location / {
try_files \$uri \$uri/ /index.html;
}
location /api/ {
proxy_pass https://api.awsmpc.asia/;
proxy_set_header Host api.awsmpc.asia;
}
location /health {
return 200 'healthy\n';
}
}
}" \
--from-literal=API_URL="https://api.awsmpc.asia" \
--from-literal=APP_NAME="Ecommerce Platform" \
--from-literal=environment.js="
window.env = {
API_URL: 'https://api.awsmpc.asia',
APP_NAME: 'Ecommerce Platform',
NODE_ENV: 'production',
REACT_APP_VERSION: '1.1.2',
REACT_APP_BUILD_VERSION: '83',
REACT_APP_GIT_COMMIT: 'ce645477c7d65f766256b53f4ac098a20c9a3da6',
REACT_APP_ENABLE_ANALYTICS: 'true',
REACT_APP_ENABLE_DEBUG: 'false',
REACT_APP_ENABLE_PWA: 'true'
};"