diff --git a/frontend/vue.config.js b/frontend/vue.config.js index 9f3d486c0..ad2c10585 100644 --- a/frontend/vue.config.js +++ b/frontend/vue.config.js @@ -7,7 +7,7 @@ function resolveSrc(_path) { let vue_path = process.env.VUE_PATH if (vue_path == undefined) { - vue_path = '' + vue_path = '/vue' } // vue.config.js diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 55d35e264..4fa5ab0d0 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -14,14 +14,6 @@ server { root /var/www/cakephp/webroot; index index.php; - location ~* \.(png|jpg|ico|webp)$ { - expires 30d; - } - - location ~* \.(js|css) { - # expires 1d; - expires 1d; - } location ~ \.php$ { fastcgi_pass community-server:9000; @@ -72,6 +64,29 @@ server { location / { try_files $uri $uri/ /index.php?$args; } + + location /vue { + + location /vue/sockjs-node { + rewrite /vue/(.*) /$1; + } + location ~* \.(png) { + expires 1d; + rewrite /vue/(.*) /$1; + } + + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + #rewrite /vue/(.*) /$1 break; + + proxy_pass http://frontend:8080; + proxy_redirect off; + } # access_log /var/log/nginx/access.log main;