nginx.conf 839 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. worker_processes 1;
  2. events {
  3. worker_connections 1024;
  4. }
  5. http {
  6. include mime.types;
  7. default_type application/octet-stream;
  8. sendfile on;
  9. keepalive_timeout 65;
  10. gzip on;
  11. gzip_static on;
  12. gzip_disable "msie6";
  13. gzip_vary on;
  14. gzip_types text/plain text/css application/javascript;
  15. map $request_method $access_control_max_age {
  16. OPTIONS 1728000; # 20 days
  17. }
  18. server_tokens off; # Hide Nginx version
  19. server {
  20. listen 8080;
  21. server_name localhost;
  22. index index.html index.htm;
  23. location / {
  24. absolute_redirect off;
  25. alias /usr/share/nginx/html/;
  26. expires 1d;
  27. location ~* \.(?:json|yml|yaml)$ {
  28. #SWAGGER_ROOT
  29. expires -1;
  30. include cors.conf;
  31. }
  32. include cors.conf;
  33. }
  34. }
  35. }