Subdomain redirection to dir xyz.test.com to test.com/xyz

What is the name of the domain?

nijeshb.site

What is the issue you’re encountering

i have created a tunnel & used subdomain mapping. test.nijeshb.site but it is redirecting to nijeshb.site/test. I have created a dummy folder with sample html file, not sure why this redirection is happening.

What are the steps to reproduce the issue?

Create a subdomain & vhost config. Check the subdomain is url is redirecting to domain/subdomain

Can you share the configuration for the public hostname on the tunnel?

Could you also perform a trace to see if any Cloudflare features interfere with the request?

1 Like

Hi Laudian,

This is the configuration

Also i have noted some page rule is enabled by default redirection rule
nijeshb.site/ to nijeshb.site/$1.
I have removed it now, but now getting 502 error , where as https://nijeshb.site/test/ this is working

Trace Result:

{
“trace”: [
{
“step_name”: “set_furl”,
“type”: “page_rule”,
“matched”: true,
“zoneName”: “nijeshb.site”
},
{
“step_name”: “set_furl_isperm”,
“type”: “page_rule”,
“matched”: true,
“zoneName”: “nijeshb.site”
},
{
“step_name”: “file_upload_scan”,
“type”: “product”,
“matched”: false,
“public_name”: “Uploaded Content Scanning”,
“zoneName”: “nijeshb.site”
},
{
“step_name”: “api_shield”,
“type”: “product”,
“matched”: false,
“public_name”: “API Shield”,
“zoneName”: “nijeshb.site”
},
{
“step_name”: “http_request_firewall_managed”,
“type”: “phase”,
“matched”: false,
“public_name”: “WAF Managed Rules”,
“trace”: [
{
“step_name”: “77454fe2d30c4220b5701f6fdfb893ba”,
“type”: “ruleset”,
“matched”: false,
“description”: “Created by the Cloudflare security team, this ruleset is designed to provide protection for free zones”,
“name”: “Cloudflare Managed Free Ruleset”,
“kind”: “managed”
}
],
“zoneName”: “nijeshb.site”
},
{
“step_name”: “request_managed_headers”,
“type”: “product”,
“matched”: false,
“managed_headers”: [
{
“id”: “add_client_certificate_headers”,
“enabled”: false
},
{
“id”: “add_visitor_location_headers”,
“enabled”: false
},
{
“id”: “remove_visitor_ip_headers”,
“enabled”: false
},
{
“id”: “add_waf_credential_check_status_header”,
“enabled”: false
}
],
“zoneName”: “nijeshb.site”
},
{
“type”: “snippets”,
“matched”: false,
“public_name”: “Snippets”,
“zoneName”: “nijeshb.site”
},
{
“type”: “cloud_connector”,
“matched”: false,
“public_name”: “Cloud Connector”,
“zoneName”: “nijeshb.site”
},
{
“step_name”: “response_managed_headers”,
“type”: “product”,
“matched”: false,
“managed_headers”: [
{
“id”: “remove_x-powered-by_header”,
“enabled”: false
},
{
“id”: “add_security_headers”,
“enabled”: false
}
],
“zoneName”: “nijeshb.site”
}
],
“status_code”: 301
}

Can you connect to http://localhost:8081 from the local machine?

Be aware that localhost might resolve to IPv4 and IPv6, so make sure you’re listening on both or change the setting to use an IP directly.

yes, i can able to connect to both localhost && localhost:8081

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.