default.conf 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. server {
  2. listen 8006;
  3. server_name localhost;
  4. gzip on;
  5. gzip_min_length 5k;
  6. gzip_buffers 4 16k;
  7. gzip_comp_level 3;
  8. gzip_types text/plain application/javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
  9. gzip_vary on;
  10. location /api {
  11. proxy_pass http://114.116.150.249:61002;
  12. proxy_redirect off;
  13. proxy_set_header Host $host;
  14. proxy_set_header X-Real-IP $remote_addr;
  15. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  16. }
  17. location ~ .*\.(?:html)$ {
  18. add_header Cache-Control "no-cache";
  19. root /usr/share/nginx/html/dist/web;
  20. index index.html;
  21. try_files $uri /index.html;
  22. }
  23. location ~.*\.(?:jpg|jpeg|js|css|svg|ttf|png){
  24. add_header expires 30d;
  25. root /usr/share/nginx/html/dist/web;
  26. }
  27. location / {
  28. root /usr/share/nginx/html/dist/web;
  29. index index.html;
  30. try_files $uri /index.html;
  31. }
  32. }