Matteo Scandolo | 3b3b3b4 | 2016-12-15 17:31:53 -0800 | [diff] [blame] | 1 | server { |
Matteo Scandolo | f4b8517 | 2017-01-11 09:56:02 -0800 | [diff] [blame] | 2 | listen 4000; |
Matteo Scandolo | 3b3b3b4 | 2016-12-15 17:31:53 -0800 | [diff] [blame] | 3 | server_name localhost; |
| 4 | |
| 5 | #charset koi8-r; |
Matteo Scandolo | f4b8517 | 2017-01-11 09:56:02 -0800 | [diff] [blame] | 6 | access_log /var/log/nginx/log/xos-spa-gui.access.log main; |
Matteo Scandolo | 37d6509 | 2017-01-12 12:03:05 -0800 | [diff] [blame] | 7 | error_log /var/log/nginx/log/xos-spa-gui.error.log debug; |
Matteo Scandolo | 3b3b3b4 | 2016-12-15 17:31:53 -0800 | [diff] [blame] | 8 | |
| 9 | location / { |
Matteo Scandolo | 37d6509 | 2017-01-12 12:03:05 -0800 | [diff] [blame] | 10 | root /var/www/dist; |
| 11 | index index.html index.htm; |
Matteo Scandolo | 3b3b3b4 | 2016-12-15 17:31:53 -0800 | [diff] [blame] | 12 | } |
| 13 | |
Matteo Scandolo | f4b8517 | 2017-01-11 09:56:02 -0800 | [diff] [blame] | 14 | # Redirect for FE config |
Matteo Scandolo | 37d6509 | 2017-01-12 12:03:05 -0800 | [diff] [blame] | 15 | |
| 16 | location /spa/ { |
| 17 | rewrite ^/spa/(.*)$ /$1; |
Matteo Scandolo | f4b8517 | 2017-01-11 09:56:02 -0800 | [diff] [blame] | 18 | } |
| 19 | |
Matteo Scandolo | 37d6509 | 2017-01-12 12:03:05 -0800 | [diff] [blame] | 20 | location /api { |
Matteo Scandolo | d62ea79 | 2016-12-22 14:02:28 -0800 | [diff] [blame] | 21 | resolver 127.0.0.1 valid=30s; |
Matteo Scandolo | 899b9b8 | 2017-04-19 15:49:49 -0700 | [diff] [blame] | 22 | proxy_pass http://xos-ws:3000; |
| 23 | # proxy_redirect http://xos-ws:3000/spa /; |
Matteo Scandolo | 3b3b3b4 | 2016-12-15 17:31:53 -0800 | [diff] [blame] | 24 | } |
| 25 | |
Matteo Scandolo | 37d6509 | 2017-01-12 12:03:05 -0800 | [diff] [blame] | 26 | location /socket.io { |
Matteo Scandolo | d62ea79 | 2016-12-22 14:02:28 -0800 | [diff] [blame] | 27 | resolver 127.0.0.1 valid=30s; |
Matteo Scandolo | 899b9b8 | 2017-04-19 15:49:49 -0700 | [diff] [blame] | 28 | proxy_pass http://xos-ws:3000; |
| 29 | # proxy_redirect http://xos-ws:3000/spa /; |
Matteo Scandolo | 37d6509 | 2017-01-12 12:03:05 -0800 | [diff] [blame] | 30 | proxy_http_version 1.1; |
| 31 | proxy_set_header Upgrade $http_upgrade; |
| 32 | proxy_set_header Connection "upgrade"; |
Matteo Scandolo | 3b3b3b4 | 2016-12-15 17:31:53 -0800 | [diff] [blame] | 33 | } |
| 34 | } |