Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asp.net Images are giving 401 unauthorized error randomly

I am using Asp.net, IIS 6 and cdn for serving images. I am having a problem with loading the images in my website. images are under a virtual folder. Everytime I hit refresh of the browser, some of the images gives 401 unauthorized error. (images and number of images displayed which gives 401 error differs in every refresh.) I am having hard time to solve this problem. Any help will be welcomed a lot.

Kind Regards.

PS: I am also using a load balancer to distribute traffic among two servers. One of the servers has actual files and a virtual folder for them. The other server has virtual folder which shows the path and ip of the server which has files. I tried using website via each server but they both have the same problem.

Here are the headers;

Response:

HTTP/1.1 401 Unauthorized
Content-Length: 1608
Content-Type: text/html
Server: Microsoft-IIS/6.0
Date: Thu, 28 Apr 2011 14:38:55 GMT

Request

GET /img/blog/2011%2f4%2f4.png HTTP/1.1
Host: cdn.***.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16 ( .NET CLR 3.5.30729)
Accept: image/png,image/*;q=0.8,*/*;q=0.5
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://www.***.com/Blog
like image 950
Artex Avatar asked Apr 28 '11 14:04

Artex


People also ask

What does 401 unauthorized access is denied due to invalid credentials mean?

The 401 Unauthorized error is an HTTP status code that means the page you were trying to access cannot be loaded until you first log in with a valid user ID and password. If you've just logged in and received the 401 Unauthorized error, it means that the credentials you entered were invalid for some reason.

How do I fix 401 unauthorized error REST API in Postman?

Unblock yourselfMake sure that the URL is typed correctly. Verify the API documentation of the service you are trying to reach and make sure you have selected the right authorization type in Postman. Visit the service provider's page and look for a Sign in link. Enter your credentials and then try the page again.


1 Answers

Add permission for following users to that virtual image folder

  1. IUSR
  2. IIS_IUSRS

After adding the above permission please check whether 401 error is still there or not?

like image 128
KiranPalode Avatar answered Sep 23 '22 20:09

KiranPalode