Reputation: 1228
I have 2 Windows 2008 R2 x64 servers NLB, ARR with shared configuration. I have the application files in a network share. ASP.net pages (.aspx) come up fine but no css,images,js work. I also have a .htm file shows css and images just fine.
In the iis log I do see a 401.3 message. So it seems to be permissions but not sure what else to configure permissions wise.
I read similiar issues at:
https://serverfault.com/questions/126978/iis-7-5-401-3-access-denied
I tried the suggested solutions - none seems to work (unless I missed something). Any advice is greatly appreciated!
Upvotes: 26
Views: 57160
Reputation: 6047
I forgot the permissions.
https://serverfault.com/a/260778/30695
Had to add IIS_IUSRS
with read permissions.
Upvotes: 0
Reputation: 12695
In my case, I had the <staticContent>
tag in the web.config
file. I had to comment it, run the project (then all css, js, images loaded), uncomment it and run the project again, somehow it worked...
Upvotes: 10
Reputation: 1551
For me, the issue was with this part of my web.config:
<authentication mode="Forms">
<forms timeout="2880" loginUrl="/Home?expired=true"
requireSSL="false" protection="All" cookieless="UseCookies" />
</authentication>
I had to change requireSSL from true to false when running under local host without https. Boom, CSS and images showed up.
Upvotes: 0
Reputation: 3105
In addition to Authentication and all the other issues mentioned above, check your web application's Handler Mappings in IIS. The culprit could be a catch-all * handler hijacking your .css and .js requests.
In my case I recently installed ColdFusion on one of our servers and that added managed handlers to IIS making all the requests to asset files to throw a 500 Internal Server Error. I disabled that handler and everything went back to normal.
Upvotes: 1
Reputation: 341
For future solution-searchers having the same or similar problem... I had the same (or similar) problem with my little asp web app. But used this solution, which worked instantly:
The solution for me was to install the “Static Content” support for IIS.
- Go to “Turn Windows features on or off”
- Select Internet Information Services
- Select World Wide Web Services
- And check Static Content
Source: http://www.dailycomputersolutions.com/blog/index.php/2010/04/23/iis-not-showing-images-and-css/
Upvotes: 34
Reputation: 1228
Okay here's what I did to resolve my issue.
Since my app files are in a file share the Anonymous user account couldn't access them. This is because by default IUSR account is used for Anoymous user. In IIS->Site->Authentication set Anonymous Authentication to Application Pool Identity if you have created a custom app pool OR you can specify an account.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -ag 1 -url "file:////\computername\sharename*" FullTrust -exclusive on
Upvotes: 35