Subdomain proxy

Normally, when I type ‘mydomain.com/@market’ in the browser, my market site opens. But I want that when someone types ‘market.mydomain.com’ in the browser, the requests should go to ‘mydomain.com/@market’ in the background. How can I write this in the Caddyfile?

1 Like

But the url changes to mydomain.com/@market. I want market.mydomain.com to be in the address bar.

Look at handle, handle_path, and route:

The issue you may run in to is if your ssl cert is for www.mydoain.com then going to market.mydomain.com will throw errors. You’ll just need to make sure you have the correct certs in place.