› NGINX
› NGINX Trac
› 3rd Party Modules
› Security Advisories
› CHANGES
› OpenResty
› ngx_lua
› Tengine
在线学习资源
› NGINX 开发从入门到精通
NGINX Modules
› ngx_echo
kayseen
V2EX  ›  NGINX

配置 nginx 直接访问/var/www/html 下面的静态 html 文件

  •  
  •   kayseen · Nov 25, 2019 · 4683 views
    This topic created in 2544 days ago, the information mentioned may be changed or developed.

    之前使用的是apache2服务器, 我把使用gitbook生成的 html 文件夹(文件夹名称为test)放在了ubuntu的/var/www/html路径下面, gitbook生成的index.html文件的路径是/var/www/html/test/index.html, 然后我直接在浏览器中访问ip/test/index.html, 就能直接打开我使用gitbook生成的html内容, 然后我现在访问路径为: ip/test/index.html 然后nginx给我提示 404,页面找不到, 这个时候我还没有配置 nginx,可以提供下思路如何配置吗?

    tip: (不是修改 nginx 的 index.html 的内容,因为后面可能会放进去 test2/index.html, test3.html)

    3 replies  •  2019-11-25 17:24:14 +08:00
    kayseen
    kayseen
    OP
    Nov 25, 2019
    1
    额额额, 已知晓, 打扰了^-^
    DANG
    DANG
    Nov 25, 2019
    2
    修改 conf 目录下的配置文件修改 location 块就行,过于基础建议直接百度
    kayseen
    kayseen
    OP
    Nov 25, 2019
    3
    @DANG
    刚接触 nginx,,现在已经解决了
    多谢哈
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4386 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 08:20 · PVG 16:20 · LAX 00:20 · JFK 03:20
    ♥ Do have faith in what you're doing.