fix(nginx): 修复宿主机端口映射下的跳转丢失问题

添加 absolute_redirect off 配置,并修正后台链接末尾斜杠,解决宿主机 8011 映射容器 80 时跳转丢失端口的问题
This commit is contained in:
sugar1569 2026-09-23 16:34:28 +08:00
parent d01154d117
commit 8a42db5089
2 changed files with 4 additions and 1 deletions

View File

@ -35,7 +35,7 @@ $host = $_SERVER['HTTP_HOST'];
<a href="<?php echo 'http://'.$host;?>" class="btn mid">进入前台</a>
</div>
<div class="admin btn">
<a href="<?php echo 'http://'.$host;?>/admin" class="btn btn_submit J_install_btn mid">进入后台</a>
<a href="<?php echo 'http://'.$host;?>/admin/" class="btn btn_submit J_install_btn mid">进入后台</a>
</div>
</div>
</div>

View File

@ -6,6 +6,9 @@ server {
root /var/www/public;
# 端口映射场景(宿主机 8011 -> 容器 80):目录补斜杠 301 使用相对 Location,
# 避免跳转后丢失宿主机映射端口
absolute_redirect off;
location / {
# try_files $uri /index.php$is_args$args;