From 481a2219ce67f6226b3d49be21f61a08206ac188 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 2 Jun 2017 09:29:14 +0200 Subject: [PATCH] =?UTF-8?q?Ruta=20desarrollo=20http://localhost:5000,=20pr?= =?UTF-8?q?oducci=C3=B3n=2080?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/main-menu/main-menu.js | 2 +- services/auth/server/application.json | 4 ++-- services/auth/server/boot/routes.js | 1 + services/nginx/Dockerfile | 2 +- services/nginx/conf-dev.conf | 19 +++++++++---------- services/nginx/conf-prod.conf | 18 +++++++++--------- services/salix/client/index.ejs | 2 +- services/salix/server/boot/routes.js | 2 +- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/client/salix/src/components/main-menu/main-menu.js b/client/salix/src/components/main-menu/main-menu.js index f2bc6e5d1..113c940b8 100644 --- a/client/salix/src/components/main-menu/main-menu.js +++ b/client/salix/src/components/main-menu/main-menu.js @@ -8,7 +8,7 @@ export default class Controller { this.modules = modulesFactory.getModules(); } onLogoutClick() { - this.$window.location = 'salix/logout'; + this.$window.location = '/logout'; } onChangeLanguage() { let lang = this.$translate.use() == 'en' ? 'es' : 'en'; diff --git a/services/auth/server/application.json b/services/auth/server/application.json index 31f1c422b..8dfbe63d7 100644 --- a/services/auth/server/application.json +++ b/services/auth/server/application.json @@ -1,4 +1,4 @@ { - "default": "salix/login", - "salix": "/salix/login" + "default": "/login", + "salix": "/login" } \ No newline at end of file diff --git a/services/auth/server/boot/routes.js b/services/auth/server/boot/routes.js index 1c49fa0f7..c4809d66d 100644 --- a/services/auth/server/boot/routes.js +++ b/services/auth/server/boot/routes.js @@ -41,6 +41,7 @@ module.exports = function(app) { let query = url.parse(req.body.location, true).query; let loginUrl = applications[query.apiKey]; + if (!loginUrl) loginUrl = applications.default; diff --git a/services/nginx/Dockerfile b/services/nginx/Dockerfile index 8a5775434..06443e596 100644 --- a/services/nginx/Dockerfile +++ b/services/nginx/Dockerfile @@ -14,4 +14,4 @@ RUN echo listen-address=127.0.0.1 > /etc/dnsmasq.d/dnsmasq.conf CMD service dnsmasq restart && nginx -g "daemon off;" -EXPOSE 8080 \ No newline at end of file +EXPOSE 80 \ No newline at end of file diff --git a/services/nginx/conf-dev.conf b/services/nginx/conf-dev.conf index 43faaca1a..157091514 100644 --- a/services/nginx/conf-dev.conf +++ b/services/nginx/conf-dev.conf @@ -21,29 +21,29 @@ http { scgi_temp_path temp/scgi; server { - listen 8080; + listen 5000; server_name localhost; autoindex off; - location ~ ^/static(?:/(.*))?$ { + location ~ ^/static/(?:(.*))?$ { proxy_pass http://127.0.0.1:8081/$1$is_args$args; } - location ~ ^/auth(?:/(.*))?$ { + location ~ ^/auth/(?:(.*))?$ { proxy_pass http://127.0.0.1:3000/$1$is_args$args; } - location ~ ^/salix(?:/(.*))?$ { - proxy_pass http://127.0.0.1:3001/$1$is_args$args; - } - - location ~ ^/client(?:/(.*))?$ { + location ~ ^/client/(?:(.*))?$ { proxy_pass http://127.0.0.1:3002/$1$is_args$args; } - location ~ ^/mailer(?:/(.*))?$ { + location ~ ^/mailer/(?:(.*))?$ { proxy_pass http://127.0.0.1:3003/$1$is_args$args; } + + location ~ ^/(?:(.*))?$ { + proxy_pass http://127.0.0.1:3001/$1$is_args$args; + } } types { @@ -59,4 +59,3 @@ http { image/jpeg jpeg jpg; } } - diff --git a/services/nginx/conf-prod.conf b/services/nginx/conf-prod.conf index ac7f22dcb..4e3af4c0c 100644 --- a/services/nginx/conf-prod.conf +++ b/services/nginx/conf-prod.conf @@ -13,7 +13,7 @@ http { include /etc/nginx/mime.types; server { - listen 8080; + listen 80; server_name localhost; autoindex off; @@ -24,20 +24,20 @@ http { autoindex on; } - location ~ ^/auth(?:/(.*))?$ { + location ~ ^/auth/(?:(.*))?$ { proxy_pass http://auth:3000/$1$is_args$args; } - location ~ ^/salix(?:/(.*))?$ { - proxy_pass http://salix:3001/$1$is_args$args; - } - - location ~ ^/client(?:/(.*))?$ { + location ~ ^/client/(?:(.*))?$ { proxy_pass http://client:3002/$1$is_args$args; } - location ~ ^/mailer(?:/(.*))?$ { + location ~ ^/mailer/(?:(.*))?$ { proxy_pass http://mailer:3003/$1$is_args$args; } + + location ~ ^/(?:(.*))?$ { + proxy_pass http://salix:3001/$1$is_args$args; + } } -} \ No newline at end of file +} diff --git a/services/salix/client/index.ejs b/services/salix/client/index.ejs index 9caf8950e..9ed38a508 100644 --- a/services/salix/client/index.ejs +++ b/services/salix/client/index.ejs @@ -3,7 +3,7 @@ Salix - + diff --git a/services/salix/server/boot/routes.js b/services/salix/server/boot/routes.js index 993e16eb6..235b134aa 100644 --- a/services/salix/server/boot/routes.js +++ b/services/salix/server/boot/routes.js @@ -27,7 +27,7 @@ module.exports = function (app) { validateToken(token, function(isValid) { if (isValid) { res.cookie('vnToken', token/*, {httpOnly: true}*/); - res.redirect(continueUrl ? continueUrl : '/salix'); + res.redirect(continueUrl ? continueUrl : '/'); } else redirectToAuth(res);