0

My application has the following architecture,

  1. An angular 1.5 application has a service which sends request to one of endpoints on server.

  2. The request is received by an nginx server if it is an http request it is redirected to https server.

  3. Then the nginx server redirects my request to upstream node server.

In angular I use the http service to send get and post request.

I don't know if my request along with the data are travelling encrypted by https protocol or as plain text by http protocol from angular to server and back.Can someone please clarify what is going on, the data might contains personal details of user and it is important that it is encrypted.

This question asks the same but is not answered properly.

Thank You.

1
  • Stop sending http requests, they are not secure even if there is a https re-direct. Commented Jun 28, 2016 at 12:26

1 Answer 1

1

You can force $http to use HTTPS simply by ensuring that your URL is formatted correctly.

var req = {
 method: 'POST',
 url: 'https://localhost/api/v1/users', // note: https specified
 headers: {
   'Content-Type': undefined
 },
 data: { test: 'test' }
}

angularjs docs - $https

Sign up to request clarification or add additional context in comments.

1 Comment

Such a simple solution!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.