nginx-server.conf 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. server {
  2. listen 80 default_server;
  3. server_name _;
  4. # 启动Gzip Json模式 ######################################################
  5. gzip_http_version 1.0; # gzip支持http协议 proxy 必须用
  6. gzip on;
  7. gzip_vary on;
  8. gzip_proxied any;
  9. gzip_static on;
  10. gzip_comp_level 4;
  11. gzip_min_length 256;
  12. gzip_buffers 4 8k;
  13. gzip_types text/html text/plain application/javascript application/x-javascript text/css application/xml application/json;
  14. location /parse/{
  15. proxy_set_header Host $http_host;
  16. proxy_set_header X-Real-IP $remote_addr;
  17. proxy_set_header X-Scheme $scheme;
  18. proxy_set_header X-Forwarded-Proto $scheme;
  19. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  20. proxy_pass http://127.0.0.1:61337/parse/;
  21. proxy_redirect off;
  22. }
  23. location /api/parse/{
  24. proxy_set_header Host $http_host;
  25. proxy_set_header X-Real-IP $remote_addr;
  26. proxy_set_header X-Scheme $scheme;
  27. proxy_set_header X-Forwarded-Proto $scheme;
  28. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  29. proxy_pass http://127.0.0.1:61337/parse/;
  30. proxy_redirect off;
  31. }
  32. root /var/www/edu-textbook/;
  33. location /{
  34. try_files $uri $uri/ /index.html?$query_string;
  35. }
  36. }