bdkjones / CodeKit2

CodeKit 2 Beta
98 stars 4 forks source link

Domain name gets replaced on page #631

Closed PublicKeys closed 7 years ago

PublicKeys commented 7 years ago

Just started using CodeKit with browser refresh - I had been using it only for compiling LESS files. I had been using built-in nginx and php to work on the site locally using http://domain-name/. That works when I click on the preview, but instead of seeing that in the browser, I see this: http://macbook-pro-2016.local:5757. The site loads correctly, and it does refresh if I change CSS. BUT any instance of "domain-name" on the page gets replaced by "http://macbook-pro-2016.local:5757". That's real annoying when the site name is supposed to appears on the page. How can I get it to NOT do that?

Thanks

PublicKeys commented 7 years ago

I found a work around. I added a host entry for d0main-name and set up the server to respond to d0main-name. It doesn't do any replacing because it doesn't match any more.

There still should be a way to prevent it from happening...

bdkjones commented 7 years ago

Http://domain-name/ is not a valid address. It works because you can set up a vhost for that name, but it's still an invalid name for the Internet because it's missing a TLD.

Use domain-name.dev or domain-name.site, etc. in your virtual host.

CodeKit replaces instances of the origin server's address with the proxy server's address because that is exactly how reverse proxy servers work. If the app did not do this, you'd be taken directly to the origin server when you click a link, etc.

bdkjones commented 7 years ago

For speed, CodeKit simply replaces all instances of the origin server address. You're getting burned because your virtualhost address is not a valid one. Use the correct form and then instances of just "domain-name" on the page will not be modified.