Skip to content
二哥的秘密小站

时间漂流船

二哥的秘密小站

时间漂流船

如何将本机域名反代到本机特定端口

Posted on 2022年2月21日

如果本机域名是www.example.com,我希望当我输入www.example.com的时候,会跳转到www.example.com:1008,要怎么做呢?

首先,在本机建立一个名为www.example.com的网站,然后点击SSL证书下方进入网站的“反向代理”,添加反向代理,随便写一个,保存。然后点击配置文件,清空,复制粘贴以下代码,保存即可。

 

#PROXY-START/

location /
{
proxy_pass http://127.0.0.1:1008;
proxy_set_header Host $host;
}
location /ws
{
proxy_pass http://127.0.0.1:1008;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “Upgrade”;
proxy_set_header Host $host;
}
location /terminal
{
proxy_pass http://127.0.0.1:1008;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “Upgrade”;
proxy_set_header Host $host;
}
#PROXY-END/

未分类

文章导航

Previous post
Next post

Search

Archives

  • 2025 年 7 月
  • 2025 年 6 月
  • 2025 年 1 月
  • 2024 年 12 月
  • 2024 年 3 月
  • 2024 年 2 月
  • 2023 年 12 月
  • 2023 年 9 月
  • 2023 年 8 月
  • 2023 年 7 月
  • 2023 年 6 月
  • 2023 年 5 月
  • 2023 年 4 月
  • 2023 年 2 月
  • 2022 年 12 月
  • 2022 年 10 月
  • 2022 年 8 月
  • 2022 年 7 月
  • 2022 年 6 月
  • 2022 年 2 月

其他操作

  • 注册
  • 登录
  • 条目 feed
  • 评论 feed
  • WordPress.org
©2025 二哥的秘密小站 | WordPress Theme by SuperbThemes