前端微调

This commit is contained in:
BBIT-Kai
2025-11-05 18:08:04 +08:00
parent 4c2ae9e809
commit 3d46cef3bd
5 changed files with 421 additions and 1 deletions
+14
View File
@@ -0,0 +1,14 @@
FROM nginx:1.27.4-alpine
# 配置 nginx
RUN echo "types { application/javascript js mjs; }" > /etc/nginx/conf.d/mjs.conf \
&& rm -rf /etc/nginx/conf.d/default.conf
# 只拷贝打包好的 dist
COPY apps/bot_web_test /usr/share/nginx/html
# 拷贝 nginx 配置
COPY scripts/deploy/nginx_aibottest.conf /etc/nginx/nginx.conf
#EXPOSE 8092 因为使用kong做网关 可以直接使用ce-vue:8091访问 所以这里可以不暴露给内网
CMD ["nginx", "-g", "daemon off;"]
+37
View File
@@ -0,0 +1,37 @@
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
server {
listen 8092;
server_name localhost;
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /test_page.html;
index test_page.html;
# Enable CORS
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}