关于站点地址的一个问题
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 12.4k
- Forks
- 2.1k
- PR merge metrics
- No merged PRs in 30d
Description
1. 该问题的重现步骤是什么?
部署在局域网内,并且通过端口映射提供公网访问时,因为站点地址设置的问题,肯定会有一个冲突
例如,部署在192.168.1.1的局域网内,通过公网映射到公网 10.100.100.1的80上,这时因为设置了站点地址(这个是必须设置的属性),如果设置为192.168.1.1,则10.100.100.1访问时,很多资源地址获取会返回192.168.1.1为服务主机的URI地址,这样浏览器会因为不能正确获得相应文件而出现问题。其中默认主题页面显示就会出现这样的问题,相应的css等内容都不能正常加载。
此外一些通过vpn来联网的也会出现类似的问题。采用虚拟局域网组网的,比如用zoreTier组网,同时满足局域网和公网使用的Typecho站点
2. 你期待的结果是什么?实际看到的又是什么?
系列资源的加载采用匹配浏览器的相对路径,而不是基于站点地址组合。
3. 问题出现的环境
该问题和环境没有本质关联。
- 操作系统版本:Debian9
- Apache/NGINX 版本:Nginx1.10
- 数据库版本:mariadb 10.1
- PHP 版本:7.0
- Typecho 版本:17.10
- 浏览器版本:任何浏览器都会出现该问题。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue identifies no file, test, or entry point. Start by tracing how Typecho builds resource URLs from the configured site address, reproduce the LAN/public mapping described, and verify that generated CSS and other resource links remain usable from the public address without breaking normal deployments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100