健康同学微信公众号h5项目
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

69 rindas
1.8KB

  1. #user nobody;
  2. worker_processes 1;
  3. #error_log logs/error.log;
  4. #error_log logs/error.log notice;
  5. error_log /var/log/nginx/error.log warn;
  6. pid /var/run/nginx.pid;
  7. events {
  8. accept_mutex on; #设置网路连接序列化,防止惊群现象发生,默认为on
  9. multi_accept on; #设置一个进程是否同时接受多个网络连接,默认为off
  10. use epoll; #事件驱动模型,select|poll|kqueue|epoll|resig|/dev/poll|eventport
  11. worker_connections 1024;
  12. }
  13. http {
  14. include mime.types;
  15. default_type application/octet-stream;
  16. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  17. '$status $body_bytes_sent "$http_referer" '
  18. '"$http_user_agent" "$http_x_forwarded_for"';
  19. #access_log logs/access.log main;
  20. access_log /var/log/nginx/access.log main;
  21. sendfile on;
  22. #tcp_nopush on;
  23. #keepalive_timeout 0;
  24. keepalive_timeout 65;
  25. #打包之后产生.gz文件, 还需要在nginx服务器配置静态压缩
  26. #gzip on;
  27. #gzip on;
  28. #gzip_min_length 1k;
  29. #gzip_buffers 4 16k;
  30. #gzip_http_version 1.0;
  31. #gzip_comp_level 2;
  32. #gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
  33. #gzip_vary off;
  34. #gzip_disable "MSIE [1-6].";
  35. server {
  36. listen 80;
  37. server_name localhost;
  38. #charset koi8-r;
  39. charset utf-8;
  40. location / {
  41. root /app; # 指向目录
  42. index index.html;
  43. try_files $uri $uri/ /index.html;
  44. gzip_static on; #静态压缩
  45. }
  46. error_page 500 502 503 504 /50x.html;
  47. location = /50x.html {
  48. root /usr/share/nginx/html;
  49. }
  50. }
  51. }