nginx.conf 789 B

123456789101112131415161718192021
  1. server {
  2. listen 30002;
  3. server_name localhost;
  4. gzip on;
  5. gzip_min_length 1k;
  6. gzip_vary on;
  7. 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 applicatio n/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/svg+xml;
  8. location /api {
  9. proxy_pass http://127.0.0.1:61002;
  10. add_header Access-Control-Allow-Origin *;
  11. add_header Access-Control-Allow-Methods *;
  12. if ($request_method = 'OPTIONS') {
  13. return 204;
  14. }
  15. }
  16. location / {
  17. root /mnt/new/enterprise;
  18. index index.html index.htm;
  19. try_files $uri $uri/ /index.html;
  20. }
  21. }