malladmin.conf.j2 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. server {
  2. listen 80;
  3. server_name saas.niusenyun.com; # 替换为您的域名
  4. access_log /var/log/nginx/malladmin_access.log;
  5. error_log /var/log/nginx/malladmin_error.log;
  6. root {{ deploy_path }}/backendui/dist-prod;
  7. index index.html;
  8. # Gzip 压缩配置
  9. gzip on;
  10. gzip_min_length 1k;
  11. gzip_buffers 16 64k;
  12. gzip_http_version 1.1;
  13. gzip_comp_level 4;
  14. gzip_types
  15. application/javascript
  16. application/x-javascript
  17. text/javascript
  18. text/css
  19. text/xml
  20. application/xhtml+xml
  21. application/xml
  22. application/json
  23. application/x-httpd-php
  24. application/x-yaml
  25. application/yaml
  26. application/vnd.ms-fontobject
  27. application/x-font-ttf
  28. font/opentype
  29. image/svg+xml
  30. image/x-icon
  31. text/plain;
  32. gzip_vary on;
  33. gzip_proxied any;
  34. gzip_disable "MSIE [1-6]\.";
  35. location / {
  36. try_files $uri $uri/ /index.html;
  37. #expires 7d;
  38. #add_header Cache-Control "public, no-transform";
  39. }
  40. # 静态资源缓存设置
  41. #location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
  42. #expires 30d;
  43. #add_header Cache-Control "public, no-transform";
  44. #}
  45. location /admin-api/ { ## 后端项目 - 管理后台
  46. proxy_pass http://localhost:48080/admin-api/; ## 重要!!!proxy_pass 需要设置为后端项目所在服务器的 IP
  47. proxy_set_header Host $http_host;
  48. proxy_set_header X-Real-IP $remote_addr;
  49. proxy_set_header REMOTE-HOST $remote_addr;
  50. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  51. }
  52. location /app-api/ { ## 后端项目 - 用户 App
  53. proxy_pass http://localhost:48080/app-api/; ## 重要!!!proxy_pass 需要设置为后端项目所在服务器的 IP
  54. proxy_set_header Host $http_host;
  55. proxy_set_header X-Real-IP $remote_addr;
  56. proxy_set_header REMOTE-HOST $remote_addr;
  57. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  58. }
  59. # 禁止访问隐藏文件
  60. location ~ /\. {
  61. deny all;
  62. access_log off;
  63. log_not_found off;
  64. }
  65. }