server { listen 80; server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
rewrite ^/([^\.]+)$ /$1 break;
add_header 'Access-Control-Allow-Origin' 'http://${BACKEND_ADDR}:${BACKEND_PORT}';
}
location /api/v1 {
proxy_pass http://${BACKEND_ADDR}:${BACKEND_PORT};
proxy_http_version 1.1;
client_max_body_size 100M;
}
location /api/v1/ws/ {
proxy_pass http://${BACKEND_ADDR}:${BACKEND_PORT};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
const router = new VueRouter({
mode: 'history',
...
})