Advertisement
DeaD_EyE

nginx config with websocket and api endpoints

Aug 21st, 2019
532
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. map $http_upgrade $connection_upgrade {
  2.     default upgrade;
  3.     '' close;
  4. }
  5.  
  6. upstream websocket {
  7.     server 127.0.0.1:6000;
  8. }
  9.  
  10. upstream api {
  11.     server 127.0.0.1:5000;
  12. }
  13.  
  14. server {
  15.     listen 80;
  16.     listen 8888;
  17.     index /static/index.html;
  18.  
  19.     location /static {
  20.         alias /home/skyradar/skyradar-sar/ui;
  21.     }
  22.     location ~^/(openapi\.json|docs|redoc|shutdown|client-config|login|state) {
  23.         include uwsgi_params;
  24.         proxy_pass http://api;
  25.     }
  26.     location /data {
  27.         proxy_pass http://websocket;
  28.         proxy_http_version 1.1;
  29.         proxy_set_header Upgrade $http_upgrade;
  30.         proxy_set_header Connection $connection_upgrade;
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement