Advertisement
Guest User

/etc/nginx/conf.d.default.conf

a guest
Sep 14th, 2017
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. upstream backend {
  2.  
  3. server localhost:8065;
  4. }
  5.  
  6. proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off;
  7.  
  8. server {
  9. listen 80;
  10. server_name food.3lc.my;
  11. # return 301 https://$server_name$request_uri;
  12. return 301 https://food.3lc.my;
  13.  
  14. location ~ /api/v[0-9]+/(users/)?websocket$ {
  15. proxy_set_header Upgrade $http_upgrade;
  16. proxy_set_header Connection "upgrade";
  17. client_max_body_size 50M;
  18. proxy_set_header Host $http_host;
  19. proxy_set_header X-Real-IP $remote_addr;
  20. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  21. proxy_set_header X-Forwarded-Proto $scheme;
  22. proxy_set_header X-Frame-Options SAMEORIGIN;
  23. proxy_buffers 256 16k;
  24. proxy_buffer_size 16k;
  25. proxy_read_timeout 600s;
  26. proxy_pass http://food.3lc.my:8065;
  27. }
  28.  
  29. location / {
  30. client_max_body_size 50M;
  31. proxy_set_header Connection "";
  32. proxy_set_header Host $http_host;
  33. proxy_set_header X-Real-IP $remote_addr;
  34. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  35. proxy_set_header X-Forwarded-Proto $scheme;
  36. proxy_set_header X-Frame-Options SAMEORIGIN;
  37. proxy_buffers 256 16k;
  38. proxy_buffer_size 16k;
  39. proxy_read_timeout 600s;
  40. proxy_cache mattermost_cache;
  41. proxy_cache_revalidate on;
  42. proxy_cache_min_uses 2;
  43. proxy_cache_use_stale timeout;
  44. proxy_cache_lock on;
  45. proxy_pass http://food.3lc.my:8065;
  46. }
  47. }
  48.  
  49.  
  50. server {
  51. listen 443 ssl http2;
  52. server_name food.3lc.my;
  53. return 301 https://food.3lc.my:8065;
  54. ssl on;
  55. ssl_certificate /etc/letsencrypt/live/food.3lc.my/fullchain.pem;
  56. ssl_certificate_key /etc/letsencrypt/live/food.3lc.my/privkey.pem;
  57. ssl_session_timeout 5m;
  58. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  59. ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
  60. ssl_prefer_server_ciphers on;
  61. ssl_session_cache shared:SSL:10m;
  62. location / {
  63. proxy_http_version 1.1;
  64. }
  65.  
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement