You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.2 KiB

  1. user nginx;
  2. worker_processes 1;
  3. pid /var/run/nginx.pid;
  4. events {
  5. worker_connections 1024;
  6. # multi_accept on;
  7. }
  8. http {
  9. sendfile on;
  10. tcp_nopush on;
  11. tcp_nodelay on;
  12. keepalive_timeout 65;
  13. types_hash_max_size 2048;
  14. server_tokens off;
  15. port_in_redirect on;
  16. server_names_hash_bucket_size 128;
  17. server_name_in_redirect off;
  18. client_max_body_size 60m;
  19. include /etc/nginx/mime.types;
  20. default_type application/octet-stream;
  21. send_timeout 300;
  22. client_body_timeout 300;
  23. client_header_timeout 300;
  24. access_log /logs/access.log;
  25. error_log /logs/error.log;
  26. gzip on;
  27. gzip_disable "msie6";
  28. gzip_vary on;
  29. gzip_proxied any;
  30. gzip_comp_level 6;
  31. gzip_buffers 16 8k;
  32. gzip_http_version 1.1;
  33. gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
  34. upstream thumbor {
  35. server thumbor:80;
  36. }
  37. server {
  38. listen 80 default;
  39. server_name localhost;
  40. add_header 'Access-Control-Allow-Origin' '*';
  41. add_header 'Access-Control-Allow-Credentials' 'true';
  42. add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
  43. add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With';
  44. if ($request_method = 'OPTIONS') {
  45. return 204;
  46. }
  47. location ~* "^/(..)(..)(.+)?$" {
  48. root /data/result_storage/v2/$1/$2;
  49. expires 1M;
  50. error_page 404 = @fetch;
  51. }
  52. location @fetch {
  53. internal;
  54. proxy_pass http://thumbor$request_uri;
  55. }
  56. location ~ /\.ht { deny all; }
  57. location ~ /\.hg { deny all; }
  58. location ~ /\.svn { deny all; }
  59. }
  60. }