-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subdomains not working in 1.0.0 #2233
Comments
I am concerned about adding cc @SpaceK33z, we’ll probably need someone from Webpack side to help us understand implications of this. |
Thanks for the fast reply. An option to add wildcards to the development environment would be a decent solution for most people using subdomains I guess. As long as everything can stay dynamic in production, since it would not be an option to add a new wildcard every time a user creates or changes a new subdomain entity. |
It's more of a security risk if you use the proxy feature since you could potentially proxy to a process like Werkzeug that lets you run arbitrary code in its debugger. |
I see, thanks for clarifying. |
We will need webpack/webpack-dev-server#899 to make this happen. 😄 A separate PR just to add |
Seems like this is blocked on WDS then. I don't want to relax the check completely. |
I'm sure there's a few ways to hit this, but one way we hit this was trying to expose our local server via ngrok. So it may be useful to find a way to resolve this for non |
Here is a quick and dirty workaround if you need to run your dev app on domains other than localhost :
|
Hmm. I wonder if the |
Our setup is using the built-in I may have to try out @ArnaudD suggestion, though we aren't hurting to upgrade |
I have a proposed solution here: #2288. |
Please update to If you do use the |
For me this still doesnt fix it when i try to go to: http://test.localhost:3000/ |
Have you updated to 1.0.2? Are you using the proxy feature? If you do, have you followed the new instructions in the migration guide for 1.0.2? |
yes, updated to 1.0.2 What host do I need to specify in .env.development if I want to visit my app on http://test.localhost:3000/ (or http://name1.localhost:3000/, or http://name2.localhost:3000/) ? guess i m missing something, because in a blank test project, visiting these 'subdomains' does indeed work. |
Let's reopen the issue for subdomain use case specifically, as we should indeed support any subdomains of But in the meantime you can add |
webpack/webpack-dev-server#899 (which also allows subdomains) |
The PR mentioned above was merged and released in 2.7.0, and react-scripts already uses that version. So it should work now? |
I'd expect so. Let's close this. If it doesn't work happy to reopen. |
Even though the This means if you want to use the proxy feature (to forward requests to a backend API, for example), WDS will check the host, and subdomains (e.g. |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue. |
Description
Since 1.0.0 we cannot visit subdomains on the dev server anymore. This is usfeful for devs who use subdomains to serve different data based on subdomains with CRA.
Expected behavior
Visiting the app on http://test.localhost:3000/ should display the app the same as the usual: http://localhost:3000/
Actual behavior
Instead of the app we get: Invalid Host header
Reproducible Demo
create a new react app and visit any subdomain.
Extra
disableHostCheck: true
in the webpackDevServer.config ?
The text was updated successfully, but these errors were encountered: