1 Resposta
- Mais recentes
- Mais votos
- Mais comentários
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.
respondido há um ano
Conteúdo relevante
- Como personalizo a configuração do nginx para modificar “client_max_body_size” no Elastic Beanstalk?AWS OFICIALAtualizada há um ano
- AWS OFICIALAtualizada há 4 meses
- AWS OFICIALAtualizada há 2 anos
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;