Nginx 代理管理器 proxy_pass 不起作用

Nginx 代理管理器 proxy_pass 不起作用

在 Nginx 代理管理器上我有此配置(名称已删除)

# ------------------------------------------------------------
# www.lab.myself.it
# ------------------------------------------------------------


server {
  set $forward_scheme http;
  set $server         "127.0.0.1";
  set $port           81;

  listen 80;
listen [::]:80;

  server_name www.lab.myself.it;

  access_log /data/logs/proxy-host-2_access.log proxy;
  error_log /data/logs/proxy-host-2_error.log warn;

  location /wiki/ {
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Scheme $scheme;
    proxy_set_header X-Forwarded-Proto  $scheme;
    proxy_set_header X-Forwarded-For    $remote_addr;
    proxy_set_header X-Real-IP          $remote_addr;
    proxy_pass       http://maersk.lab.myself.it:8181/;

  }

  location / {
    # Proxy!
    include conf.d/include/proxy.conf;
  }

  # Custom
  include /data/nginx/custom/server_proxy[.]conf;
}

理想情况下我应该能够浏览到http://www.lab.myself.it/wikiNginx 应该将我发送到http://maersk.lab.myself.it:8181

问题是,由于浏览器无法加载 CSS、JS 或图像,因此我得到的网页很简单。当我尝试点击 wiki 上的链接时,它会带我到http://www.lab.myself.it/documentation<-- 缺少 /WIKI/

答案1

您需要在应用程序中正确设置基本 URL wiki

相关内容