Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Pro

 AfterLogic Forum : AfterLogic WebMail Pro
Subject Topic: Reverse Proxy and Cookie Domain Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
golaat
Newbie
Newbie


Joined: 17 January 2022
Location: United States
Online Status: Offline
Posts: 3
Posted: 17 January 2022 at 8:06pm | IP Logged Quote golaat

I am trying to run WebMail Pro on an internal machine behind a reverse proxy. It looks like the cookie domain is defaulting to the name of the host and I get a message stating "cookies are not enabled" when I attempt to access the site via the reverse proxy. Is there a way I can override the cookie domain being used?
Back to Top View golaat's Profile Search for other posts by golaat
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6110
Posted: 17 January 2022 at 11:17pm | IP Logged Quote Igor

Hello,

According to the developers, the error is shown when WebMail Pro is setting a test cookie and cannot access it. In the code, we're only setting cookie path, not the domain. My guess is that part needs to be adjusted on webserver configuration level. For example, in case of Nginx that can be done using proxy_cookie_domain setting.

--
Regards,
Igor, Afterlogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
golaat
Newbie
Newbie


Joined: 17 January 2022
Location: United States
Online Status: Offline
Posts: 3
Posted: 18 January 2022 at 8:53pm | IP Logged Quote golaat

I am using IIS10 with with UrlRewrite and Application Request Routing following this guidancehttps://techcommunity.microsoft.com/t5/iis-support-blog/setup-iis-with-url-rewrite-as-a-reverse-proxy-for-real-world/ba-p/846222.

I suspect that the cookies are scoped to the content serving machine. Any help would be appreciated.
Back to Top View golaat's Profile Search for other posts by golaat
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6110
Posted: 19 January 2022 at 6:24am | IP Logged Quote Igor

Perhaps the answer from here would help:

Quote:
To preserve the Host Header run this from command line to update Machine/webroot/apphost config

Code:
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/proxy -preserveHostHeader:true /commit:apphost


--
Regards,
Igor, Afterlogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
golaat
Newbie
Newbie


Joined: 17 January 2022
Location: United States
Online Status: Offline
Posts: 3
Posted: 20 January 2022 at 7:30pm | IP Logged Quote golaat

I was actually able to resolve this, however perhaps there is a more elegant solution that would allow me to do what I was originally attempting.

On my internal machine, the website was being served up at /webmail-pro/. Externally, I was serving it up at just the root of the site (ie: http://mail.mysite.com/) and reverse proxying the traffic back to the internal machine at /webmail-pro. This caused the cookies to not be set, since they as scoped to a specific folder path. I found that if I serve up the site externally at http://mail.mysite.com/webmail-pro it works just fine.

I saw that in the config file I can specify a cookie path; I tried setting that to /, but it did not work. I am glad I was able to get this to work, but wonder if it would be possible to do what I was originally intending and serve it up at the root of the site externally.
Back to Top View golaat's Profile Search for other posts by golaat
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide