diff --git a/.gitignore b/.gitignore index b12f322a2..5c23ad8bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.log -/node_modules/* \ No newline at end of file +/node_modules/* +.vscode diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 97cdb3155..e5d5d25c4 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -38,6 +38,10 @@ services: ## NGINX ################################################ ######################################################### nginx: + depends_on: + - frontend + - community-server + - login-server volumes: - ./logs:/var/log/nginx @@ -60,4 +64,4 @@ services: volumes: frontend_node_modules: - conan: \ No newline at end of file + conan: \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index b0c30ca66..567018dd1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,8 +16,6 @@ services: target: production networks: - external-net - depends_on: - - nginx ports: - 8080:8080 environment: @@ -135,4 +133,4 @@ networks: internal: true volumes: - db_vol: + db_vol: \ No newline at end of file diff --git a/frontend/vue.config.js b/frontend/vue.config.js index 537477c6d..babcc63d7 100644 --- a/frontend/vue.config.js +++ b/frontend/vue.config.js @@ -15,6 +15,7 @@ module.exports = { } }, lintOnSave: true, + publicPath: '/vue/', configureWebpack: { // Set up all the aliases we use in our app. resolve: { @@ -30,5 +31,6 @@ module.exports = { css: { // Enable CSS source maps. sourceMap: process.env.NODE_ENV !== 'production' - } + }, + outputDir: path.resolve(__dirname, "/vue" ), }; diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 064395336..cdc418d05 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -12,15 +12,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; @@ -67,9 +58,33 @@ server { proxy_pass http://login-server:1201; proxy_redirect off; } + + 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; + } location / { - try_files $uri $uri/ /index.php?$args; + try_files $uri $uri/ /index.php?$args; } # access_log /var/log/nginx/access.log main;