nginx.conf 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #user nobody;
  2. worker_processes 2;
  3. pcre_jit on ;
  4. timer_resolution 500ms;
  5. # This default error log path is compiled-in to make sure configuration parsing
  6. # errors are logged somewhere, especially during unattended boot when stderr
  7. # isn't normally logged anywhere. This path will be touched on every nginx
  8. # start regardless of error log location configured here. See
  9. # https://trac.nginx.org/nginx/ticket/147 for more info.
  10. #
  11. #error_log /var/log/nginx/error.log;
  12. #
  13. #pid logs/nginx.pid;
  14. events {
  15. worker_connections 1024;
  16. use kqueue;
  17. }
  18. http {
  19. include mime.types;
  20. default_type application/octet-stream;
  21. sendfile on;
  22. keepalive_timeout 65;
  23. tcp_nopush on;
  24. aio on;
  25. gzip on;
  26. gzip_comp_level 6;
  27. gzip_min_length 1100;
  28. gzip_buffers 16 8k;
  29. gzip_types text/plain
  30. text/css
  31. text/javascript
  32. text/xml
  33. text/x-component
  34. application/javascript
  35. application/x-javascript
  36. application/json
  37. application/xml
  38. application/rss+xml
  39. application/atom+xml
  40. font/truetype
  41. font/opentype
  42. application/vnd.ms-fontobject
  43. image/svg+xml;
  44. gzip_proxied any;
  45. output_buffers 1 32k;
  46. postpone_output 1460;
  47. types {
  48. text/plain log;
  49. }
  50. ssl_dhparam /usr/local/etc/nginx/dhparam.pem;
  51. ssl_protocols TLSv1.2 TLSv1.3;
  52. ssl_ecdh_curve X25519:P-521:P-384:P-256;
  53. ssl_prefer_server_ciphers on;
  54. ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384";
  55. ssl_session_cache shared:SSL:10m;
  56. ssl_session_timeout 15m;
  57. ssl_session_tickets off;
  58. server {
  59. http2 on;
  60. listen 80 ;
  61. listen [::]:80 ;
  62. server_name poudriere.lapinbilly.eu ;
  63. #charset koi8-r;
  64. #access_log logs/host.access.log main;
  65. root /usr/local/share/poudriere/html;
  66. # Allow caching static resources
  67. location ~* ^.+\.(jpg|jpeg|gif|png|ico|svg|woff|css|js|html)$ {
  68. add_header Cache-Control "public";
  69. expires 2d;
  70. }
  71. # redirect server error pages to the static page /50x.html
  72. #
  73. error_page 500 502 503 504 /50x.html;
  74. location = /50x.html {
  75. root /usr/local/www/nginx-dist;
  76. }
  77. #access_log logs/host.access.log main;
  78. location /data {
  79. alias /usr/local/poudriere/data/logs/bulk;
  80. # Allow caching dynamic files but ensure they get rechecked
  81. location ~* ^.+\.(log|txz|tbz|bz2|gz)$ {
  82. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  83. }
  84. # Don't log json requests as they come in frequently and ensure
  85. # caching works as expected
  86. location ~* ^.+\.(json)$ {
  87. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  88. access_log off;
  89. log_not_found off;
  90. }
  91. # Allow indexing only in log dirs
  92. location ~ /data/?.*/(logs|latest-per-pkg)/ {
  93. autoindex on;
  94. }
  95. break;
  96. }
  97. location /packages {
  98. root /usr/local/poudriere/data;
  99. autoindex on;
  100. }
  101. }
  102. }