应用创建完成后,Serverless 应用引擎 SAE(Serverless App Engine)会免费提供一个默认的私网地址。本文介绍如何通过私网访问应用。
背景信息
SAE提供的默认私网访问域名,用于测试环境调试。在生产环境,建议使用自定义域名访问应用。
前提条件
通过私网访问应用
-
登录SAE控制台。
-
在左侧导航栏,选择,在顶部菜单栏选择地域,然后在应用列表页面,单击目标应用名称,在基础信息页面的HTTP 流量全托管区域,复制私网访问地址。
-
在左侧导航栏,单击版本列表,然后将光标放置在目标版本操作列的Webshell区域,最后单击目标实例名称。
-
在登录实例命令行界面,输入
curl https://cn-****-****.<RegionID>-vpc.sae.run命令后回车,此命令会通过私网访问您的应用。如果配置正确,您将在命令行界面看到应用返回的HTML页面(或其他格式的数据)。其中,https://cn-****-****.<RegionID>-vpc.sae.run为本文第2步中复制的私网访问地址。root@c-65f801d2-1522405d-8c0dd8xxx:/workspace# curl https://cn-hangxxx-mmorxxx.cn-hangzhou-vpc.sae.run <!DOCTYPE html> <html> <head> <title>Congratulations | SAE</title> <style> .container { max-width: 700px; margin-left: auto; margin-right: auto; } .hero { margin-top: 172px; } .hero .message { ... } </style> </head> <body> ... </body> </html> font-size: 15px; text-align: center; margin-bottom: 24px; } .congrats { ...
该文章对您有帮助吗?