default.conf 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # from gis project
  2. server {
  3. listen 80;
  4. listen [::]:80;
  5. server_name localhost;
  6. client_max_body_size 1024M;
  7. set $root '/usr/share/nginx/html';
  8. root $root;
  9. location / {
  10. index index.html index.htm;
  11. add_header Access-Control-Allow-Origin *;
  12. try_files $uri $uri/ @router;
  13. }
  14. location @router {
  15. rewrite ^.*$ /index.html last;
  16. }
  17. location /api/ {
  18. proxy_pass http://admin:2021/;
  19. proxy_read_timeout 300s;
  20. proxy_set_header X-Real-IP $remote_addr;
  21. proxy_set_header x-forwarded-for $remote_addr;
  22. proxy_set_header REMOTE-HOST $remote_addr;
  23. add_header X-Cache $upstream_cache_status;
  24. #Set Nginx Cache
  25. add_header Cache-Control no-cache;
  26. if ( $uri ~* "/profile.*/(.*)" ){
  27. add_header Access-Control-Expose-Headers "Content-Disposition";
  28. add_header Content-Disposition "attachment;filename=$1";
  29. }
  30. }
  31. location ~ /.well-known {
  32. allow all;
  33. autoindex on;
  34. autoindex_exact_size off;
  35. autoindex_localtime on;
  36. }
  37. #location ~ /\.ht {
  38. # deny all;
  39. #}
  40. }