nginx.conf 799 B

123456789101112131415161718192021222324252627282930
  1. user nginx;
  2. worker_processes 1;
  3. error_log /var/log/nginx/error.log warn;
  4. pid /var/run/nginx.pid;
  5. events {
  6. worker_connections 1024;
  7. }
  8. http {
  9. server_tokens off; # 隐藏版本号
  10. include /etc/nginx/mime.types;
  11. default_type application/octet-stream;
  12. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  13. access_log /var/log/nginx/access.log main;
  14. sendfile on;
  15. keepalive_timeout 65;
  16. gzip on;
  17. server {
  18. listen 80;
  19. root /usr/share/nginx/html;
  20. index index.html;
  21. error_page 404 /index.html; #将404错误页面重定向到index.html可以解决history模式访问不到页面问题
  22. # location ^~/api/ {
  23. # proxy_pass http://backend:8080;
  24. # rewrite "^/api/(.*)$" /$1 break;
  25. # }
  26. }
  27. }