blob: b392f6172d411039816ecf39ccfab8aa7a8942f8 [file] [log] [blame]
Matteo Scandolo3b3b3b42016-12-15 17:31:53 -08001server {
Matteo Scandolof4b85172017-01-11 09:56:02 -08002 listen 4000;
Matteo Scandolo3b3b3b42016-12-15 17:31:53 -08003 server_name localhost;
4
5 #charset koi8-r;
Matteo Scandolof4b85172017-01-11 09:56:02 -08006 access_log /var/log/nginx/log/xos-spa-gui.access.log main;
Matteo Scandolo37d65092017-01-12 12:03:05 -08007 error_log /var/log/nginx/log/xos-spa-gui.error.log debug;
Matteo Scandolo3b3b3b42016-12-15 17:31:53 -08008
9 location / {
Matteo Scandolo37d65092017-01-12 12:03:05 -080010 root /var/www/dist;
11 index index.html index.htm;
Matteo Scandolo3b3b3b42016-12-15 17:31:53 -080012 }
13
Matteo Scandolof4b85172017-01-11 09:56:02 -080014 # Redirect for FE config
Matteo Scandolo37d65092017-01-12 12:03:05 -080015
16 location /spa/ {
17 rewrite ^/spa/(.*)$ /$1;
Matteo Scandolof4b85172017-01-11 09:56:02 -080018 }
19
Matteo Scandolo37d65092017-01-12 12:03:05 -080020 location /api {
Matteo Scandolod62ea792016-12-22 14:02:28 -080021 resolver 127.0.0.1 valid=30s;
Matteo Scandolo899b9b82017-04-19 15:49:49 -070022 proxy_pass http://xos-ws:3000;
23 # proxy_redirect http://xos-ws:3000/spa /;
Matteo Scandolo3b3b3b42016-12-15 17:31:53 -080024 }
25
Matteo Scandolo37d65092017-01-12 12:03:05 -080026 location /socket.io {
Matteo Scandolod62ea792016-12-22 14:02:28 -080027 resolver 127.0.0.1 valid=30s;
Matteo Scandolo899b9b82017-04-19 15:49:49 -070028 proxy_pass http://xos-ws:3000;
29 # proxy_redirect http://xos-ws:3000/spa /;
Matteo Scandolo37d65092017-01-12 12:03:05 -080030 proxy_http_version 1.1;
31 proxy_set_header Upgrade $http_upgrade;
32 proxy_set_header Connection "upgrade";
Matteo Scandolo3b3b3b42016-12-15 17:31:53 -080033 }
34}