Search Posts

Category: nginx

Grunt correspoding Nginx configuration for Angular application

how to Grunt correspoding Nginx configuration for Angular application I have a configuration for Grunt server below livereload: { options: { open: true, middleware: function (connect) { return [ modRewrite([‘^[^.]*$ /index.html [L]’]), connect.static(‘.tmp’), connect().use( ‘/bower_components’, connect.static(‘./bower_components’) ), connect().use( ‘/app/styles’, connect.static(‘./app/styles’) ), connect.static( ]; } } }, It works perfectly with Grunt development-environment, but now I would like to have the same modRewrite configuration for Nginx also, as I put the app into production. What is […]

reloading the deep route after removing the ‘#’ from url in express angular app throwing error

I tried to remove the hashtag from url in angular app. Issue: The redirection works perfectly if I first load the index page and then goto any route, however, it throws an error when I reload any deep route page directly. If I refresh any page : localhost:3001/about, It throws error however when I route from index page <a href=”/about”>About </a> it works. I checked many answers for modrewrite, however, none worked for me. In […]

How to pre-render my dynamic web page which is using angularjs(v1) and nginx

I have a dynamic page for the specific image and video like and 2562 is the id of content which is dynamic. I want to share this URL in social share in FB and Twitter. The problem is when I do copy and paste this URL into FB or twitter the meta tag of the index.html is not updated(cause this website is single page application). I have seen the solution from site. But […]

First page load is really slow – Angular 1.3 + Meteor

My application is based on angular 1.3 + Meteor And my page loads are slow, especially the first-page load. How can I optimize these page loads? Is there any tool or something to debug what is taking so much time? I have been reading articles, some of them were saying that images should not be placed in myapp/public folder, I don’t understand what is the purpose of myapp/public folder then? I would really appreciate […]

Send huge json data to nodejs server using $http

I wanted to send a huge data(approx 5MB) from my Angularjs application to nodejs server, my node server is hosted in kube’s cluster due to some reason we are unable to update the nginx configuration, So is there any possibility I can send my json daa in chunk’s or convert the JSON data object to a file and send as multipart http request ? is this a good idea? Source: AngularJS

AngularJS i18n is not working in NGINX

I actually work in a project using AngularJS project with i18n for multiple languages but recently I’ve try to mount the project in a server using Nginx with dist/ folder but when I check the page I saw that i18n did not work correctly. The strange thing is that it works correctly when I open index.html in browser The server show: When I need: I using the next configuration in nginx: upstream frontend { server […]

Serving two different angular apps at one domain with wildcard in path

Say I have a Dog app written in AngularJS and I’m now adding a new Grooming sub-app written in Angular4 Right now I have nginx serving /api to a backend php server with the /api prefix rewritten off (so it doesn’t know it’s in a sub-path) and / served by the frontend AngularJS app. These are two distinct apps, each in their own server directory. This works fine right now. Now we are adding a […]