Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mike Chambers 636 posts 1253 karma points c-trib
    Sep 26, 2013 @ 13:10
    Mike Chambers
    0

    {record.IP} on cloud host with multinode and loadbalancing...

    So at present because of the multinode/loadbalanced setup of my host, all the log entries in the contour admin screens are showing as coming from the same IP, the ip of the external interface on the load balancer.

    My host provides a header for the client ip.. 

    In order for this to be correctly logged as the record.IP do I need to add something like this into my custom workflows?

     

    public override WorkflowExecutionStatus Execute(Umbraco.Forms.Core.Record record, Umbraco.Forms.Core.RecordEventArgs e)
            {
                try
                {
                    record.IP = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_CLUSTER_CLIENT_IP"];
                    RecordStorage rs = new RecordStorage();
                    rs.UpdateRecord(record, e.Form);
                    rs.Dispose();
                }
                catch { }
            }
    

    Or is there an easier way to override the defaulte REMOTE_ADDR that I presume the ip logger is using?

     

    Thanks for any help

    Mike

  • Comment author was deleted

    Sep 26, 2013 @ 14:57

    Nope that would be it

Please Sign in or register to post replies

Write your reply to:

Draft