reactjs - React Router no input file specified -
i'm using react-router navigate page auth page. here code:
import react, {component} 'react'; import reactdom 'react-dom'; import {provider} 'react-redux'; import {createstore, applymiddleware} 'redux'; import {router, route, indexroute, browserhistory} 'react-router'; import reducers './reducers'; import app './components/app'; import authenticate './components/auth/index'; import login './components/auth/login'; reactdom.render( <provider store={createstorewithmiddleware(reducers)}> <router history={browserhistory}> <route path="authenticate"> <indexroute component={login} /> <route path="/login" component={login}/> </route> <route path="/" component={app}> <indexroute component={login} /> </route> </router> </provider> , document.queryselector('.container') ); reactdom.render( <provider store={createstorewithmiddleware(reducers)}> <router history={browserhistory}> <route path="/authenticate" component={authenticate}> <indexroute component={login} /> <route path="login" component={login}/> </route> <route path="/" component={app}> </route> </router> </provider> , document.queryselector('.container') );
the problem every time navigate authenticate/login
no input file specified.
. if navigate /
works properly
any solution?
hi having same problem , solution worked met.
react-router not create real pages. in case compiled js loaded @ index.html if go /login example not loading index.php , give 404.
the error "no input file specified." ubuntu ngnix error.
solution
you can modify ngnix config file adding following code:
try_files $uri $uri/ /index.html$is_args$args;
it should added in server > location. config file looks like:
server { listen 80; listen 443 ssl; server_name yourownurl.com; root "/home/vagrant/path/to/your/site"; index index.html index.htm index.php; charset utf-8; location / { try_files $uri $uri/ /index.html$is_args$args; } }
hope helps people out.
Comments
Post a Comment