Answered by:
XFF not working on IIS10

Question
-
User-16375674 posted
Hello Cool People,
I'm trying to add XFF on my IIS 10 instance but after adding the header and hitting apply, I don't see that logs appending the _X on the last part. I did check that the W3C service is started and even restarted IIS and the server itself with no avail.
I notice this error log entry on the event viewer though:
Event ID: 6002
W3C Logging Service failed to create the log file directory E:\ for site id '1'
Does any one experience the same? I hope someone can shed some light on this
Thanks!
Sunday, March 17, 2019 12:30 AM
Answers
-
User-848649084 posted
Hi,
It seems that this is permission related issue. Did you set specific permission to log directory? Are you trying to use the non-admin user to access the site? Try to set the log directory as a default which is set by IIS.
Regards,
Jalpa.
- Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
Friday, March 29, 2019 1:39 AM
All replies
-
User-2064283741 posted
This should work no problem.
Make sure you have the correct syntax.
X-Forwarded-For
rather than underscores in there.
Sunday, March 17, 2019 12:44 AM -
User-16375674 posted
I tried adding the following:
X-FORWARDED-FOR or x-forwarded-for but nothing works. The IIS logs files should have date_X on it when I made the same changes on IIS8.5
Sunday, March 17, 2019 1:07 AM -
User-2064283741 posted
Thinking about it I did have a little grief once getting this working where the logs Date_x wasn't appearing.
Set it at the server level not the individual site level. And run an iisreset
so you are all refreshed.
Sunday, March 17, 2019 3:35 AM -
User-16375674 posted
Thanks for the response, I also tried both, Setting it from the server level,doesn't pick it up. Removing from the server level and adding it to the site level logging, no dice as well. :( All the hint I get is the error message in the event logs.
Sunday, March 17, 2019 3:54 AM -
User-848649084 posted
Hi kuystorj,
To add X-Forwarded-For Header in log file you could follow below steps:
- Select site from connection pane which you want to add header field.
- Click Logging.
-
Click the Select Fields... option.
- Click the Add Field... option.
- Configure the fields as indicated below:
Field Name: X-Forwarded-For
Source type: Request Header
Source name: X-Forwarded-For (syntax important)
-
Click OK twice.
- Click Apply in the top right of the logging options page.
- Close iis manager console.
- Run command iisreset.
Regards,
Jalpa.
Monday, March 25, 2019 7:57 AM -
User-16375674 posted
Hello Jalpa,
Thanks for the response. I actually was able to add the header the only issue that I am seeing is that the the log is not picking up the xff configuration that I added. Could the log directory by of an issue here? The Directory is pointing to "E:\" does that matter?
Tuesday, March 26, 2019 9:01 PM -
User-848649084 posted
Hi,
Could you share log detail and log directory detail? and which permission is assigned to your log directory?
Wednesday, March 27, 2019 1:16 AM -
User-16375674 posted
I was able to setup the XFF on a development box with the same IIS version. The only thing that is different is the log location. The Dev box is pointing to the default location while the Prod box that is not picking up the the XFF configuration is set to drive E:\. Will try to change the log directory location and see if that would work
Wednesday, March 27, 2019 1:57 PM -
User-848649084 posted
Hi,
You could also try to set specific permission for log directory to update log detail.
Thursday, March 28, 2019 2:06 AM -
User-16375674 posted
So I tried adding XFF again on that prod box. Still the log directory pointing to E:\ and notice that it stops generating logs. Removing XFF header and then it starts writing log again, weird
Thursday, March 28, 2019 2:45 PM -
User-848649084 posted
Hi,
It seems that this is permission related issue. Did you set specific permission to log directory? Are you trying to use the non-admin user to access the site? Try to set the log directory as a default which is set by IIS.
Regards,
Jalpa.
- Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
Friday, March 29, 2019 1:39 AM