【问题标题】:How to resolve "Index of" problem on nginx如何解决 nginx 上的“索引”问题
【发布时间】:2018-12-21 05:27:49
【问题描述】:

我在 nginx 上配置了这个角色:

  On server file:
    location ~ .php$ {
    root /var/www/public;
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    #fastcgi_param  SCRIPT_FILENAME  /var/www/public$fastcgi_script_name;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    }

  # On Domain file
  location /support {
  try_files $uri $uri/ /index.php;
  autoindex on;
  autoindex_exact_size off;
  }
  #for admin panel 

  location ^~ /support/admin {
  try_files $uri $uri/ /admin/index.php;
  autoindex on;
  autoindex_exact_size off;
  }

我在添加自动索引时解决了 403 错误问题;线, 但是当我单击我的域时看到“支持索引”消息 当我想单击 index.html 文件时,该文件不显示,而是下载完成。 我该如何解决这个问题以及我的共享代码中的问题是什么

【问题讨论】:

    标签: nginx


    【解决方案1】:

    试试这个

    location /support { default_type "text/html"; types { application/octet-stream html; } … }

    【讨论】:

    • 问题依旧
    猜你喜欢
    • 1970-01-01
    • 2014-10-07
    • 1970-01-01
    • 1970-01-01
    • 2022-01-26
    • 1970-01-01
    • 1970-01-01
    • 2019-03-19
    • 1970-01-01
    相关资源
    最近更新 更多