zammad.conf 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #
  2. # this is an example nginx config for Zammad
  3. # Please visit https://docs.zammad.org for further input on how to configure
  4. # your nginx to work with Zammad
  5. #
  6. # This is a NON SSL configuration, DO NOT use in production!
  7. #
  8. upstream zammad-railsserver {
  9. server 127.0.0.1:3000;
  10. }
  11. upstream zammad-websocket {
  12. server 127.0.0.1:6042;
  13. }
  14. server {
  15. listen 80;
  16. listen [::]:80;
  17. # replace 'localhost' with your fqdn if you want to use zammad from remote
  18. server_name localhost;
  19. # security - prevent information disclosure about server version
  20. server_tokens off;
  21. root /opt/zammad/public;
  22. access_log /var/log/nginx/zammad.access.log;
  23. error_log /var/log/nginx/zammad.error.log;
  24. client_max_body_size 50M;
  25. location ~ ^/(assets/|robots.txt|humans.txt|favicon.ico|apple-touch-icon.png) {
  26. expires max;
  27. }
  28. # legacy web socket server
  29. location /ws {
  30. proxy_http_version 1.1;
  31. proxy_set_header Upgrade $http_upgrade;
  32. proxy_set_header Connection "Upgrade";
  33. proxy_set_header CLIENT_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_read_timeout 86400;
  37. proxy_pass http://zammad-websocket;
  38. }
  39. # action cable
  40. location /cable {
  41. proxy_http_version 1.1;
  42. proxy_set_header Upgrade $http_upgrade;
  43. proxy_set_header Connection "Upgrade";
  44. proxy_set_header CLIENT_IP $remote_addr;
  45. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  46. proxy_set_header X-Forwarded-Proto $scheme;
  47. proxy_read_timeout 86400;
  48. proxy_pass http://zammad-railsserver;
  49. }
  50. location / {
  51. proxy_set_header Host $http_host;
  52. proxy_set_header CLIENT_IP $remote_addr;
  53. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  54. proxy_set_header X-Forwarded-Proto $scheme;
  55. # Change this line in an SSO setup
  56. proxy_set_header X-Forwarded-User "";
  57. proxy_read_timeout 300;
  58. proxy_pass http://zammad-railsserver;
  59. gzip on;
  60. gzip_types text/plain text/xml text/css image/svg+xml application/javascript application/x-javascript application/json application/xml;
  61. gzip_proxied any;
  62. }
  63. }