worker_processes auto; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; client_max_body_size 20m; server { listen 80; server_name localhost; location / { rewrite '^/(.*)\.br$' /br?channelCode=$1 permanent; root /usr/share/nginx/html; #配置Vue项目根路径,与 index index.html index.html; #配置首页 try_files $uri $uri/ /index.html; #防止刷新报404 } #error_page 404 /404.html; #location = /40x.html { #} error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } }