V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
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 · 2019-11-25 17:05:14 +08:00 · 3805 次点击
    这是一个创建于 1606 天前的主题,其中的信息可能已经有所发展或是发生改变。

    之前使用的是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 条回复    2019-11-25 17:24:14 +08:00
    kayseen
        1
    kayseen  
    OP
       2019-11-25 17:14:16 +08:00
    额额额, 已知晓, 打扰了^-^
    DANG
        2
    DANG  
       2019-11-25 17:18:30 +08:00
    修改 conf 目录下的配置文件修改 location 块就行,过于基础建议直接百度
    kayseen
        3
    kayseen  
    OP
       2019-11-25 17:24:14 +08:00
    @DANG
    刚接触 nginx,,现在已经解决了
    多谢哈
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1355 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 23:42 · PVG 07:42 · LAX 16:42 · JFK 19:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.