1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
Hi from what you were writing I understand, that you want to bypass the nodejs server to serve your static files for the single page app.
To do so you have to point nginx to the right folder in the file system where Elastic Beanstalk deployed your app to.
You do so with the root
element, e.g. root /var/www/main;
.
For more detailed information see https://www.nginx.com/blog/creating-nginx-rewrite-rules/ and https://www.digitalocean.com/community/tutorials/understanding-nginx-server-and-location-block-selection-algorithms.
If runtime/performance is not an issue it might be easier to configure your nodejs server to serve the static files for the single page app, too and
proxy_pass
the location /singlePageApp/
accordingly, too.
répondu il y a un an
Contenus pertinents
- demandé il y a 7 mois
- demandé il y a un an
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 9 mois
Thank you, I figured it out after reading the digital ocean document. I wasn't trying to bypass the nodejs server to serve my static files for the single page app but the nodejs server was built using Angular Universal which is a standalone nodejs app so it doesn't have access to the other files by default.
Btw, the root for Elastic Beanstalk is
root /var/app/current;