chrissharp123

Untitled

Sep 12th, 2019
224
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # File /etc/nginx/sites-available/osrf-ws-http-proxy
  2. #
  3. # $ ln -s /etc/nginx/sites-available/osrf-ws-http-proxy \
  4. # /etc/nginx/sites-enabled/osrf-ws-http-proxy
  5. # $ sudo service nginx restart
  6. #
  7. # Assumes Apache is listening on HTTP=7080 and HTTPS=7443
  8.  
  9. server {
  10. listen 80;
  11.  
  12. location / {
  13. proxy_pass http://127.0.0.1:7080;
  14. proxy_set_header Host $host;
  15. proxy_set_header X-Real-IP $remote_addr;
  16. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  17. proxy_set_header X-Forwarded-Proto $scheme;
  18. proxy_read_timeout 180s;
  19. }
  20.  
  21. }
  22.  
  23. server {
  24. listen 443;
  25. ssl on;
  26.  
  27. # Use the same SSL certificate as Apache.
  28. ssl_certificate /etc/apache2/ssl/server.crt;
  29. ssl_certificate_key /etc/apache2/ssl/server.key;
  30. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # omit SSLv3 because of POODLE
  31. ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
  32. ssl_prefer_server_ciphers on;
  33. ssl_dhparam /etc/apache2/ssl/dhparams.pem;
  34.  
  35. location / {
  36. proxy_pass https://127.0.0.1:7443;
  37. proxy_set_header Host $host;
  38. proxy_set_header X-Real-IP $remote_addr;
  39. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  40. proxy_set_header X-Forwarded-Proto $scheme;
  41. proxy_read_timeout 180s;
  42. }
  43.  
  44. location /osrf-websocket-translator {
  45. proxy_pass http://127.0.0.1:7682;
  46. proxy_set_header X-Real-IP $remote_addr;
  47. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  48.  
  49. # Needed for websockets proxying.
  50. proxy_http_version 1.1;
  51. proxy_set_header Upgrade $http_upgrade;
  52. proxy_set_header Connection "upgrade";
  53.  
  54. # Raise the default nginx proxy timeout values to an arbitrarily
  55. # high value so that we can leverage osrf-websocket-translator's
  56. # timeout settings.
  57. proxy_connect_timeout 1m;
  58. proxy_send_timeout 1m;
  59. proxy_read_timeout 1m;
  60. }
  61. }
RAW Paste Data