SHARE
TWEET

nginx config with websocket and api endpoints

DeaD_EyE Aug 21st, 2019 (edited) 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top