default.conf 1.1 KB

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