react-https-redirect icon indicating copy to clipboard operation
react-https-redirect copied to clipboard

Subdomains won't load on localhost

Open paulballas opened this issue 7 years ago • 2 comments

This works great for an app with a single domain, but my subdomains don't load on localhost.

Example foo.localhost:3000 automatically redirects to https://foo.localhost:3000/ and throws an error

paulballas avatar Sep 20 '17 16:09 paulballas

Having this same issue

kaitlynbrown avatar Mar 13 '19 19:03 kaitlynbrown

Use the disabled property and use your env variables to dynamically disable this feature :

In the .env file, when you want to disable the feature, add:

REACT_APP_DISABLED_HTTPS_REDIRECT=true

In your App :

import React from 'react';
import HttpsRedirect from 'react-https-redirect';

const App = () => (
  <HttpsRedirect disabled={process.env.REACT_APP_DISABLED_HTTPS_REDIRECT === 'true'}>
    [...]
  </HttpsRedirect>
);

export default App;

antitoine avatar Apr 03 '20 07:04 antitoine