You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, Thanks for a great blueprint to start with.
I have deployed our Ember App using Lightning Deploy Strategy which involves:
EC2 instance
Nginx (HTTP Server)
Redis, configured on same instance (to serve index.html)
compiled js and assets from AWS S3
When, upon hitting the instance, the index.html gets served from Redis, and subsequently on clicking any route in the App, the App routes get served cos it knows which js to execute.
But, when I manually enter any correct route in URL for the Ember App and to a Hard Reload, Nginx throws an error saying route not found. Anything wrong that we are doing here regarding this deploy strategy?
When a subrequest, say, mydomain.com/login is hit with the url or the page is refreshed, the browser sends a requests to nginx and nginx won't be able to find the login page anywhere and will return a 404 error. This is because nginx won't be able to pass the subroutes to index.html page which in turn can serve the subroutes. To solve this the following location block is used in nginx.
# This block handles the subrequest. If any subroutes are requested than this rewrite the url to root and tries to render the subroute page by passing the subroute to index file (which is served by the redis).
location ~* / {
rewrite ^ / last;
}
Here we are saying to nginx, for any subrequests, rewrite the url to root (/) location (root location serves the index page from redis) and find the requested page. The last option tries to find the particular page by revisiting all the blocks defined in nginx as a result of which it is able to go to root location.
A detailed explanation and full nginx config can be found here.
Firstly, Thanks for a great blueprint to start with.
I have deployed our Ember App using Lightning Deploy Strategy which involves:
EC2 instance
But, when I manually enter any correct route in URL for the Ember App and to a Hard Reload, Nginx throws an error saying route not found. Anything wrong that we are doing here regarding this deploy strategy?
Also posted this on Stackoverflow: Link
The text was updated successfully, but these errors were encountered: