--- apiVersion: v1 kind: ConfigMap metadata: name: bdtp-digital-front namespace: persagy labels: name: bdtp-digital-front data: nginx.conf: | #user tony; worker_processes 4; error_log /var/log/nginx/error.log; pid /run/nginx.pid; worker_rlimit_nofile 100001; # Load dynamic modules. See /usr/share/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" "$request_time"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.1; gzip_comp_level 2; gzip_types text/plain application/x-javascript application/css text/css application/xml text/javascript application/x-httpd-php gzip_vary on; server { listen 80 default_server; root /usr/persagy/saas-web; location /app { try_files $uri $uri/ /app/index.html; } # FMS location /fms { try_files $uri $uri/ /fms/index.html; } # FMS location /rwd-edit-pages { try_files $uri $uri/ /rwd-edit-pages/index.html; } # environmentHealth location /environmenthealth { try_files $uri $uri/ /environmenthealth/index.html; } # pdfreport location /pdfreport { try_files $uri $uri/ /pdfreport/index.html; } # BI location /hedylamarr { try_files $uri $uri/ /hedylamarr/index.html; } #NeueDashboard location /Dashboard { try_files $uri $uri/ /Dashboard/index.html; } #safetyManagement location /safetyManagement { try_files $uri $uri/ /safetyManagement/index.html; } location /equiprunmanage{ try_files $uri $uri/ /equiprunmanage/index.html; } location /wancity{ try_files $uri $uri/ /wancity/index.html; } # energybudget location /energybudget{ # 不同业务页面路由对应的静态文件首页 try_files $uri $uri/ /energybudget/index.html; } # location /api { # rewrite ^/api/(.*)$ /$1 break; # proxy_pass http://meos:80; # } location @rewrites { rewrite ^(.+)$ /index.html last; } location ~* \.(?:ico|css|js|woff|eot|otf|ttf)$ { # Some basic cache-control for static files to be sent to the browser add_header Access-Control-Allow-Origin *; } location ~index.html { add_header Cache-Control no-cache; } } } vue.config.js: | module.exports = { devServer: { proxy: { '/rwdedit': { //target: 'http://192.168.64.17:8838', target: 'http://dmp-rwd-edit:8838', }, }, }, }