1

I have an Odoo instance running on port 9069 in an Ubuntu server. Right now, apache is listening on port 8069 and is proxypass-ing this to 9069 (which works fine). The working URL is http://example.com:8069

Now, I need to make this work with SSL on the front end URL. (https://example.com:8069). However this is giving me 400 Bad request error when accessed in a browser. The exact error is:

Bad Request: Your browser sent a request that this server could not understand. Reason: You're speaking plain HTTP to an SSL-enabled server port. Instead use the HTTPS scheme to access this URL, please.Apache/2.4.33 (Ubuntu) Server at example.com Port 8069

Also I noticed the URL gets changed to http version too.

The following is the virtualhost conf I've used for the domain.

<IfModule mod_ssl.c>
<VirtualHost *:8069>

  ServerName MySite
  ServerAlias example.com:8069

   SSLEngine on
   #SSLProxyEngine on
   SSLCertificateKeyFile /etc/apache2/sslfolder/mysite.key
   SSLCertificateFile    /etc/apache2/sslfolder/mysite.crt
   SSLCertificateChainFile /etc/apache2/sslfolder/mysite.txt

  ProxyPreserveHost On
  ProxyRequests Off

  ProxyPass /longpolling/ http://localhost:8072/
  ProxyPassReverse /longpolling/ http://localhost:8072/

  ProxyPass / http://localhost:9069/
  ProxyPassReverse / http://localhost:9069/

</VirtualHost>
</IfModule>

Already checked the apache error logs, but there's no useful information there.

Note: There is another virtualhost file for example.com, which is a pretty standard one with 80 and 443 ports configured. (It's just for the website, not odoo). I will post the virtualhost if you think it's relevant.

1

I see this is months old and stumbled on it after a search. In case this is helpful to future searchers...

I do something similar with a reverse-proxy configuration, though I have not had to change the ServerName field and the ProxyPassReverse did not require the port number. So using your configuration, I would have tried:

ProxyPass / http://localhost:9069/
ProxyPassReverse / http://localhost/
0

I actually fixed it using the below modifications.

ServerName MySite

is changed to

ServerName example.com:8069

And

ProxyPass / http://localhost:9069/
ProxyPassReverse / http://localhost:9069/

is changed to

ProxyPass / http://localhost:9069/
ProxyPassReverse / http://example.com:8069/

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.