Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何开启子路径的方式访问呢,比如:http://ip:port/subpath呢 #73

Open
1447443432 opened this issue Apr 16, 2024 · 4 comments

Comments

@1447443432
Copy link

如何开启子路径的方式访问呢,比如:http://ip:port/subpath呢

@ch3nnn
Copy link
Owner

ch3nnn commented Apr 16, 2024

没太理解, 想通过子路径访问导航页?

@1447443432
Copy link
Author

您好,是的,比如我想在nginx中代理到location /links {pass_proxy http://ip:port} 后,想通过访问 http://ip:port/links 来访问导航页,我配置过了,但会有一些问题,admin站点无法访问,菜单栏无法点击打开,如下图:
image

@ch3nnn
Copy link
Owner

ch3nnn commented Apr 16, 2024

感觉是 Nginx 配置问题, 下面配置是否可以解决。

http {
    server {
        listen 80;
 
        location /links {
            proxy_pass http://backend_server;  // 服务 ip:端口
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    }
}

@1447443432
Copy link
Author

谢谢,但是不得行哎,访问 http://ip:port/links 就 404了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants