In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Summary: binding a custom domain name allows users to access FC functions through a custom domain name, which is used with HTTP triggers to facilitate the use of function computing to build Web applications.
Brief introduction
Ali Cloud functional Computing (Function Compute) is an event-driven fully managed computing service and is Ali Cloud's Serverless computing platform. To build applications based on functional computing, you do not need to manage infrastructure such as servers, but focus on the development of application logic, which greatly improves the efficiency of development.
In this paper, the construction of Serverless Web application by function calculation (1)-HTTP trigger expounds that Web application (Serverless web backend) is a very important use scene of function calculation. Compared with traditional web applications built on servers, function computing does not require you to manage the server and other infrastructure. You only need to write code and upload it. Function computing will prepare computing resources for you to run your code in a flexible and reliable manner, achieving self-scaling in milliseconds and easily coping with peak pressure.
HTTP triggers provide users with a default endpoint such as.. fc.aliyuncs.com//proxy/// [action? queries], but users want to provide services through custom domain names. The original Web applications can be accessed through custom domain names. After migration to function calculation, they can only be accessed through default endpoint.
Therefore, the function calculation introduces the function of custom domain name after the HTTP trigger.
Custom domain name
Binding a custom domain name allows users to access FC functions through a custom domain name, which can be used with HTTP triggers to facilitate the use of function computing to build Web applications.
You can bind a custom domain name on function calculation, and set different paths to different functions of different services, and then you can access different functions through the custom domain name. Your HTTP Request will be passed to the function intact, and FC will not do any processing to your HTTP Request.
For example, if you own a website whose domain name is api.app.com, from the point of view of cost and flexible expansion, you want to migrate the Web service to function computing without affecting external services, that is, the links to external services remain unchanged, then you can bind a custom domain name for your application.
Process comparison:
Use proc
Create HTTP triggers and write functions
For the building process, please refer to the HTTP trigger example.
Bind a custom domain name
Step 1: the domain name needs to be registered in Aliyun or connected to Aliyun for filing.
Please refer to the article Aliyun for the record.
Step 2: the domain name needs to be resolved to your endpoint, that is, you need to set the CNAME of the domain name to the endpoint of your corresponding region, first set the CNAME, and then bind it to the function calculation
For domain name resolution, please refer to the article setting up domain name resolution.
For example, if your domain name is app.com, your accountID is 12345, and your region is Shanghai, you need to set the CNAME of app.com to 12345.cn-shanghai.fc.aliyuncs.com.
Step 3: bind the custom domain name in the function calculation and set different paths to different functions.
Functions bound to the same domain name must be in the same region and can belong to different services
For example, you can set the request of path "/ a" to function1 execution of service1, and the request of path "/ b" to function2 execution of service2
Only a function with a HTTP trigger set can trigger execution through a request for a custom domain name.
Route matching rules
You need to set the corresponding relationship between the path and the function in the custom domain name, that is, different requested paths can trigger the execution of different functions. Function calculation supports exact matching and fuzzy matching. The specific rules are as follows:
Exact matching and fuzzy matching are supported.
Exact matching is that the set path is exactly the same as the incoming request. For example, if / a triggers F1 under service S1 (hereinafter abbreviated as s1/f1), then the request with the path of / a / cannot trigger the execution of F1.
Wildcards are supported and can only be placed at the end of the path. For example, / login/ indicates a request with a path prefix of / login/, and / login/* corresponds to s2/f2, then / login/an and / login/b/c/d will trigger the execution of f2.
The matching order is: exact matching-> fuzzy matching.
Match priority is: longest prefix match
Example:
The domain name is api.app.com, and the route matching rules are set as follows:
The final match result:
Summary
Binding a custom domain name allows users to access FC functions through a custom domain name. With HTTP triggers, you can quickly build Web applications with stable, flexible and scalable performance, which is very convenient.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.