V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
heavyrainn
V2EX  ›  NGINX

请问有哪位部署私网 showdoc 并使用 nignx 反向代理的么…请教本地图片上传无法显示的问题…

  •  
  •   heavyrainn · 2021-11-19 20:27:29 +08:00 · 1351 次点击
    这是一个创建于 859 天前的主题,其中的信息可能已经有所发展或是发生改变。
    发现 showdoc 可以私网搭后,我就开始尝试用这个工具来搭自己的知识库了(公司不能随便上外网真痛苦),但是目前发现当我使用 nginx 反向代理后,本地上传图片就无法显示了。我看了一下项目历史的 issue ,也尝试照着配置了一下,但是仍然无法正常限制图片。
    我是使用私网,docker 方式安装部署。
    我的 nignx 配置如下:
    server {
    listen 8082;
    server_name localhost;
    #charset koi8-r;
    #access_log logs/host.access.log main;
    location / {
    proxy_pass http://35.18.4.122:4999;
    index index.html index.htm;
    proxy_buffering off;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    proxy_set_header REMOTE-HOST $remote_addr;
    }
    }

    在上传图片后,图片路径被显示为![]( http://192.168.146.16/server/index.php?s=/api/attachment/visitFile/sign/7460b79b775d08c883a594e2cabed32b),其中 192.168.146.16 就是我部署反向代理的设备,但是上传后无法正常查看到图片,恳请懂得 nignx 反向代理和 showdoc 的朋友指点,非常感谢
    3 条回复    2021-11-20 09:57:38 +08:00
    szpunk
        1
    szpunk  
       2021-11-20 04:07:27 +08:00
    heavyrainn
        2
    heavyrainn  
    OP
       2021-11-20 09:22:52 +08:00
    这个文档我也参考了,一级域名和二级域名的方式我都尝试了,但是还是不行
    heavyrainn
        3
    heavyrainn  
    OP
       2021-11-20 09:57:38 +08:00
    鼓秋了半天,发现可能是端口的问题…换成监听 80 端口图片就好用了…
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4498 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 83ms · UTC 10:08 · PVG 18:08 · LAX 03:08 · JFK 06:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.