Advertisement
Guest User

Nginx WSS reverse_proxy

a guest
Aug 4th, 2014
105
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None
  1. server {
  2. listen 443 ssl;
  3.  
  4. server_name asteriskStage.xxx.yyy
  5.  
  6. ssl on;
  7. ssl_certificate /etc/asterisk/certs/xxx.yyy.pem;
  8. ssl_certificate_key /etc/asterisk/certs/xxx.yyy.key;
  9.  
  10. #ssl_session_timeout 5m;
  11. #ssl_protocols SSLv2 SSLv3 TLSv1;
  12. #ssl_ciphers HIGH:!aNULL:!MD5;
  13. #ssl_prefer_server_ciphers on;
  14.  
  15. #prevent 502 bad gateway
  16. client_header_buffer_size 256k;
  17. large_client_header_buffers 8 1024k;
  18. #prevent 502 bad gateway
  19. #large_client_header_buffers 8 32;
  20.  
  21. location / {
  22.  
  23. #proxy_set_header Host $http_host;;
  24.  
  25. # prevents 502 bad gateway error
  26. proxy_buffers 8 32k;
  27. proxy_buffer_size 64k;
  28.  
  29. # redirect all HTTP traffic to localhost:8088;
  30. proxy_pass http://127.0.0.1:8088/ws;
  31. proxy_set_header X-Real-IP $remote_addr;
  32. proxy_set_header Host $http_host;
  33. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  34. #proxy_set_header X-NginX-Proxy true;
  35.  
  36. # enables WS support
  37. proxy_http_version 1.1;
  38. proxy_set_header Upgrade $http_upgrade;
  39. proxy_set_header Connection "upgrade";
  40.  
  41. proxy_read_timeout 10800;
  42.  
  43. }
  44. }
Advertisement
RAW Paste Data Copied
Advertisement