请教一下 wordpress + nginx 内网穿透的问题.

2022-10-11 12:07:50 +08:00
 Durandcol

之前的云服务器没续费被资源回收了, 刚好手头有个老 android, 于是安装了 linux deploy,打算让它发挥余热.

nginx 是这么配置的:


server {
	listen 368;
	listen [::]:368;

	server_name _;
	root /var/www/html/wordpress;


	index index.php index.html index.htm index.nginx-debian.html;

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ =404;
	}

	location ~ \.php$ {
		include snippets/fastcgi-php.conf;
		fastcgi_pass unix:/run/php/php7.3-fpm.sock;
	}
}

现在是局域网环境下, 访问 368 端口是可以正常打开 wordpress 的.

使用 cpolar 做内网穿透 368 端口:

Tunnel Status       online
Account             **** (Plan: Free)
Version             2.92/2.96
Web Interface       127.0.0.1:4040
Forwarding          https://24a00017.cpolar.cn -> http://localhost:368
Forwarding          http://24a00017.cpolar.cn -> http://localhost:368
# Conn              0
Avg Conn Time       0.00ms

这时 使用外网链接 就无法打开 wordpres 了.

要如何修改才可以使得外网链接正常访问呢?

786 次点击
所在节点    问与答
2 条回复
ocleo1
255 天前
Durandcol
255 天前
@ocleo1 谢谢 谢谢. 一年前的了, 现在这个设备可能都翻不到了 还是非常感谢你!

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/886036

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX