default.conf 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. try_files $uri $uri/ /gis/index.html;
  11. add_header Access-Control-Allow-Origin *;
  12. autoindex off; #开启nginx目录浏览功能
  13. autoindex_exact_size off; #文件大小从KB开始显示
  14. autoindex_localtime on; #显示文件修改时间为服务器本地时间
  15. }
  16. location /api {
  17. proxy_pass http://railwayAdmin:2021;
  18. proxy_read_timeout 300s;
  19. proxy_set_header Host railway.iamsee.com;
  20. proxy_set_header X-Real-IP $remote_addr;
  21. # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  22. proxy_set_header x-forwarded-for $remote_addr;
  23. proxy_set_header REMOTE-HOST $remote_addr;
  24. add_header X-Cache $upstream_cache_status;
  25. #Set Nginx Cache
  26. add_header Cache-Control no-cache;
  27. if ( $uri ~* "/profile.*/(.*)" ){
  28. add_header Access-Control-Expose-Headers "Content-Disposition";
  29. add_header Content-Disposition "attachment;filename=$1";
  30. }
  31. }
  32. location ~ /.well-known {
  33. allow all;
  34. autoindex on;
  35. autoindex_exact_size off;
  36. autoindex_localtime on;
  37. }
  38. #location ~ /\.ht {
  39. # deny all;
  40. #}
  41. }