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

请教一个 NGINX 重定向的问题

  •  
  •   lisonfan · 2019-10-12 00:02:57 +08:00 · 1827 次点击
    这是一个创建于 1629 天前的主题,其中的信息可能已经有所发展或是发生改变。

    vue 项目

    访问 https://example.com/abc?def=123 被 301 到了 https://example.com:8443/abc/?def=123

    因为 nginx 在非 root 下运行,所以 nginx 配置监听的端口是 8443,然后通过 firewalld 转发 443 到 8443

    该如何配置才能正确重定向?( https://example.com/abc?def=123 -> https://example.com/abc/?def=123)

    1 条回复    2019-10-14 16:16:15 +08:00
    vloony
        1
    vloony  
       2019-10-14 16:16:15 +08:00
    301 时候自己手写主机名+$uri 就行了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3512 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 10:48 · PVG 18:48 · LAX 03:48 · JFK 06:48
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.