huginn 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. ## Huginn
  2. ##
  3. ## Lines starting with two hashes (##) are comments with information.
  4. ## Lines starting with one hash (#) are configuration parameters that can be uncommented.
  5. ##
  6. ###################################
  7. ## configuration ##
  8. ###################################
  9. ##
  10. ## See installation.md#using-https for additional HTTPS configuration details.
  11. upstream huginn {
  12. server unix:/home/huginn/huginn/tmp/sockets/unicorn.socket fail_timeout=0;
  13. }
  14. ## Normal HTTP host
  15. server {
  16. listen 0.0.0.0:80 default_server;
  17. listen [::]:80 ipv6only=on default_server;
  18. server_name YOUR_SERVER_FQDN; ## Replace this with something like huginn.example.com
  19. server_tokens off; ## Don't show the nginx version number, a security best practice
  20. root /home/huginn/huginn/public;
  21. ## Increase this if you want to upload large attachments
  22. client_max_body_size 20m;
  23. ## Individual nginx logs for this Huginn vhost
  24. access_log /var/log/nginx/huginn_access.log;
  25. error_log /var/log/nginx/huginn_error.log;
  26. location / {
  27. ## Serve static files from defined root folder.
  28. ## @huginn is a named location for the upstream fallback, see below.
  29. try_files $uri $uri/index.html $uri.html @huginn;
  30. }
  31. ## If a file, which is not found in the root folder is requested,
  32. ## then the proxy passes the request to the upsteam (huginn unicorn).
  33. location @huginn {
  34. ## If you use HTTPS make sure you disable gzip compression
  35. ## to be safe against BREACH attack.
  36. # gzip off;
  37. proxy_read_timeout 300;
  38. proxy_connect_timeout 300;
  39. proxy_redirect off;
  40. proxy_set_header Host $http_host;
  41. proxy_set_header X-Real-IP $remote_addr;
  42. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  43. proxy_set_header X-Forwarded-Proto $scheme;
  44. proxy_set_header X-Frame-Options SAMEORIGIN;
  45. proxy_pass http://huginn;
  46. }
  47. ## Enable gzip compression as per rails guide:
  48. ## http://guides.rubyonrails.org/asset_pipeline.html#gzip-compression
  49. ## WARNING: If you are using relative urls remove the block below
  50. ## See config/application.rb under "Relative url support" for the list of
  51. ## other files that need to be changed for relative url support
  52. location /assets/ {
  53. gzip_static on; # to serve pre-gzipped version
  54. expires max;
  55. add_header Cache-Control public;
  56. }
  57. error_page 502 /502.html;
  58. }