nginx.conf 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #这个文件给docker用的
  2. #user nobody;
  3. worker_processes 1;
  4. #error_log logs/error.log;
  5. #error_log logs/error.log notice;
  6. #error_log logs/error.log info;
  7. #pid logs/nginx.pid;
  8. events {
  9. worker_connections 1024;
  10. }
  11. http {
  12. include mime.types;
  13. default_type application/octet-stream;
  14. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  15. # '$status $body_bytes_sent "$http_referer" '
  16. # '"$http_user_agent" "$http_x_forwarded_for"';
  17. #access_log logs/access.log main;
  18. sendfile on;
  19. #tcp_nopush on;
  20. #keepalive_timeout 0;
  21. keepalive_timeout 65;
  22. client_max_body_size 10m;
  23. gzip on;
  24. gzip_min_length 5k;
  25. gzip_buffers 4 16k;
  26. gzip_http_version 1.0;
  27. gzip_comp_level 4;
  28. gzip_types text/plain application/x-javascript application/javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
  29. gzip_vary on;
  30. server {
  31. listen 80;
  32. server_name localhost;
  33. location / {
  34. root /app;
  35. try_files $uri $uri/ /index.html $uri/ =404;
  36. index index.html index.htm;
  37. }
  38. }
  39. }