I am finding it hard to deploy a project with vue webpack template. We are serving a Laravel app with nginx in our server. So opening www.example.com serves our laravel installation. Now I wanted to use www.example.com/lite to serve the lite version of the app which is an SPA build with vue-webpack template. And for that I created a location block in our nginx configuration
location /lite {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
index index.html index.htm;
alias /var/www/html/crm-lite/dist;
try_files $uri $uri/ /index.html;
}
And I have changed assetsPublicPath to assetsPublicPath: '/lite' in build/index.js; But when I open it on browse I am getting 404 not found for the static assets. The url looks like this http://example.com/lite/static/js/app.3c11ea8ceff19f8f33ff.js
If i copy the contents of the dist/ folder into our document root and open it with only ip address it works fine. Is there any configuaration i am missing? Thanks for help.
locationblock for URIs ending with.js. Try using:location ^~ /lite { ... }instead.