I created an HTTP function that is named func-http in the CustomDemo service. The function runs in a custom runtime and an anonymous HTTP trigger is specified. The following sample routing code is used to implement the HTTP server of the custom runtime:
@app.route('/test', methods = ['POST','GET'])
def test():
When I use the cURL tool or a browser to access the URL of the HTTP function, the error code 404 is returned.
  • Use the cURL tool to access the HTTP function.
    curl  -v  https://164901546557****
  • Use a browser to access the HTTP function.
    Note The URL of the HTTP function is in the following format: https://<account_id>.<region_id><version>/proxy/<serviceName>/<functionName>/<path>.


You can resolve this issue by using one of the following methods:
  • Access the function by using the subdomain that is assigned by Function Compute for the new HTTP trigger. For more information, see Step 3: Test the function.

    Subdomain format:


    Sample code:
  • Add a header that is named x-fc-invocation-target to the command that is used to access the function. Command syntax:
    curl -v -H "x-fc-invocation-target: 2016-08-15/proxy/$ServiceName/$functionName" https://<account_id>.<region_id>$path
    Sample code:
    curl -v -H "x-fc-invocation-target: 2016-08-15/proxy/CustomDemo/func-http" https://164901546557****
  • Bind a custom domain name to the function. Then, run the following command to access the function again. For more information about how to bind a domain name, see Configure a custom domain name.
    For example, if the domain name is, the following command syntax is used:
    curl -v$path
    Sample code:
    curl -v
    Important Replace /$path with the path from which a request can trigger the function in the service. The path is configured when you bind the custom domain. For more information, see Routing rules.
  • Modify your function code and deploy the function. Then, use the default URL to access the function. The following example shows the modified code:
    @app.route('/2016-08-15/proxy/CustomDemo/func-http/test', methods = ['POST','GET'])
    def test():
    Sample code:
    curl  -v  https://164901546557****