V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
Durandcol
V2EX  ›  问与答

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

  •  
  •   Durandcol · 2022-10-11 12:07:50 +08:00 · 762 次点击
    这是一个创建于 565 天前的主题,其中的信息可能已经有所发展或是发生改变。

    之前的云服务器没续费被资源回收了, 刚好手头有个老 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 了.

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

    2 条回复    2023-08-30 00:47:25 +08:00
    Durandcol
        2
    Durandcol  
    OP
       242 天前
    @ocleo1 谢谢 谢谢. 一年前的了, 现在这个设备可能都翻不到了 还是非常感谢你!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3675 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 04:24 · PVG 12:24 · LAX 21:24 · JFK 00:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.