diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-07-15 15:45:02 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:48:05 +0200 |
| commit | a196ba2c08bd16479134ab542f2560b75f19424f (patch) | |
| tree | c44ad8d0c89c8997068e7c792265bd1db43c347c /frontend/nginx.conf | |
| parent | 02997b2522b9c66072b16f1425c02e81e0085e3c (diff) | |
Make frontend independent of API
This change makes the frontend independent of the API by removing the
static file serving logic from the API server. Instead, we can serve the
frontend as static HTML over CDNs.
Diffstat (limited to 'frontend/nginx.conf')
| -rw-r--r-- | frontend/nginx.conf | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 00000000..ed7e5cfe --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,32 @@ +server { + listen 80; + server_name opendc.org; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + location /socket.io { + proxy_http_version 1.1; + + proxy_buffering off; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_pass http://api:8081/socket.io; + } + + location /tokensignin { + proxy_pass http://api:8081/tokensignin; + } + + location /api { + proxy_pass http://api:8081/api; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} |
