Run behind Apache httpd reverse proxyre

Octopus Server doesn’t seem to calculate the URLs correctly… binding to a private IP on port 9999, using apache virtual host to reverse proxy from https to http://hostname:9999.

2020-03-02 14:15:29.3806   7384     19 ERROR  Unhandled exception from web server processing GET to http://octopus.nettolicious.com:9999/: Unable to locate base URI for request: http://octopus.nettolicious.com:9999/
System.InvalidOperationException
   at Octopus.Server.Web.OctopusNancyHost.ConvertRequestToNancyRequest(HttpListenerRequest request) in OctopusNancyHost.cs:line 304
   at Octopus.Server.Web.OctopusNancyHost.HandleRequest in OctopusNancyHost.cs:line 176
System.InvalidOperationException: Unable to locate base URI for request: http://octopus.nettolicious.com:9999/
   at Octopus.Server.Web.OctopusNancyHost.ConvertRequestToNancyRequest(HttpListenerRequest request) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Web\OctopusNancyHost.cs:line 304
   at Octopus.Server.Web.OctopusNancyHost.<HandleRequest>d__21.MoveNext() in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Web\OctopusNancyHost.cs:line 176
<octopus-settings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <set key="Octopus.Communications.ServicesPort">10943</set>
  <set key="Octopus.Home">C:\Octopus</set>
  <set key="Octopus.Server.NodeName">octopus.nettolicious.com</set>
  <set key="Octopus.WebPortal.ForceSsl">false</set>
  <set key="Octopus.WebPortal.ListenPrefixes">http://172.31.14.213:9999/</set>
</octopus-settings>
<VirtualHost 172.31.14.213:80>
    ServerName octopus.nettolicious.com
    Redirect "/" "https://octopus.nettolicious.com/"
</VirtualHost>

<VirtualHost 172.31.14.213:443>
    ServerName octopus.nettolicious.com
	ProxyRequests       Off
	ProxyPreserveHost   On
	ProxyPass "/"  "http://172.31.14.213:9999/"
	ProxyPassReverse "/"  "http://172.31.14.213:9999/"
	SSLEngine on
    SSLCertificateFile "${SRVROOT}/ssl/octopus.nettolicious.com.crt"
    SSLCertificateKeyFile "${SRVROOT}/ssl/octopus.nettolicious.com.key"
</VirtualHost>

Changing ProxyPreserveHost to Off in the vhosts file fixed it.

1 Like

Hi @mmorgan6,

Thanks for the update and resolution! I’m glad to hear that you got this working.

If you have any further thoughts or questions in the future, please don’t hesitate to get in touch.

Best regards,
Daniel

1 Like