【问题标题】:How do I make pelican development server to deliver files without extension?如何让 pelican 开发服务器在没有扩展名的情况下传递文件?
【发布时间】:2013-08-12 16:08:31
【问题描述】:

我正在使用 Pelican 开发一些静态 HTML 网站,这些网站被配置为提供漂亮的 URL,但是开发服务器不提供没有文件扩展名的页面。

/output/index.html -> should be accesible sith http://localhost:8000 (works)
/output/contact.html -> should be accesible sith http://localhost:8000/contact (doesn't work)
/output/products/index.html -> should be accesible sith http://localhost:8000/products (doesn't work)

在生产环境中,这是由 nginx 提供的,它配置正确,因此它确实为具有漂亮 URL 的文档提供服务。

问题是如何让 devenv 服务器做同样的事情?

【问题讨论】:

    标签: python pelican


    【解决方案1】:

    “devserver”只是python -m SimpleHTTPServer 的包装,顾名思义,它是一个非常简单的Web 服务器,不具备Nginx 的所有重写功能。潜在的解决方案包括:

    1. 通过 /output/products/index.html 模式输出所有文件并在 http://localhost:8000/products/ 本地访问(但不是 http://localhost:8000/products

    2. 在本地安装和配置 nginx 以匹配服务器端配置

    【讨论】:

    【解决方案2】:

    似乎缺少此功能,但我只需付出很少的努力就可以将此功能添加到 SimpleHTTPServer。

    这是拉取请求https://github.com/getpelican/pelican/pull/1040

    【讨论】:

      猜你喜欢
      • 2015-12-06
      • 2013-05-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-16
      • 2014-05-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多