Odoo Help


Openerp 7 SSL redirect

on 5/24/13, 6:32 AM 12,381 views

OpenERP 7 Linux Server SSL Setup installed with the below steps given in the url:-


Working SSL with below url:-


Issues in the below url:-


           Not redirect  http into https

How to auto redirect from http into https?

Added following lines to redirct [http into https] (outside of the <directory> config blocks) into the file /etc/apache2/sites-available/default

RewriteEngine on
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]

But the above code is not redirect http into https ?

How to redirect in openerp 7 in linux server?

On 12/25/13, 10:55 AM

Hi David, I don't quite get which one you meant would work. I'm on Apache2. Where is your config supposed to be? In Apache.conf or 'default' in sites-available or in '.htaccess' in var/www?

Please advice. Thank you. -Timrea.


Davide Corio

--Davide Corio--

| 5 4 7
Bricherasio, Italy
--Davide Corio--

Odoo Evangelist and Consultant

Davide Corio
On 5/24/13, 6:38 AM

Try with:

<VirtualHost *:80>
  ServerName myservername
  RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

If this won't work, Apache is probably ignoring the rule.

Also, replace * with your ip or server name if this is the case.

Thanks for reply added the code /etc/apache2/httpd.conf 1) access url http://servername connection time out error but able to access in https://servername. and unable to redirect http://ipaddress

on 5/24/13, 7:10 AM

have you defined the <VirtualHost *:443> directive?

Davide Corio
on 5/24/13, 7:12 AM

Yes Virtual Host defined in the path /etc/apache2/sites-avilable/openerp-ssl

on 5/24/13, 7:17 AM

i just noticed that you're typing http://ip:port and https://ip:port. you should just type http://ip and you should get redirected to https://ip. in order to avoid typing :port you need to properly configure a proxy directive

Davide Corio
on 5/24/13, 7:20 AM



| 5 5 7
Bikaner, India

OpenERP Developer at SunARC Technology

On 5/24/13, 7:19 AM

I followed the steps http://pastebin.com/uGVtBxQ3 but still SSL issues not solved.

Now I tried the below conf code:-

<VirtualHost *:443>
 ServerName openerp.servername.com
 SSLEngine On
 SSLCertificateFile /etc/apache2/ssl/server.crt
 SSLCertificateKeyFile /etc/apache2/ssl/server.key
 ProxyRequests Off
 <Proxy *>
 Order deny,allow
 Allow from all
 ProxyVia On
 ProxyPass /
<location / >
 ProxyPassReverse /  
 RequestHeader set "X-Forwarded-Proto" "https"
#Fix IE problem (httpapache proxy dav error 408/409)
 SetEnv proxy-nokeepalive 1

But issues is when typed https://openerp.servername.com/ in the browser then the output page open with http://openerp.servername.com/ instead of https.

[Redirect also applied in conf file but no changes]

Suppose i changed conf code

ProxyPass /
     Changed into 
ProxyPass /

After that typed https://openerp.servername.com/ in the browser then the output page open with https://openerp.servername.com/ but show message It Works! but no content has been added, yet.

In OpenERP 6 version SSL Connection openerp-web.cfg has the following lines:

tools.proxy.on = True
tools.proxy.base = 'http://HOST.com/openerp'
tools.proxy.local = ''

But in OpenERP 7 version openerp-web.cfg file not available where to add the above line in openerp version 7?

Please give me solution how to solve this issue? Thanks

the following is a working conf: http://pastebin.com/uGVtBxQ3

Davide Corio
on 5/24/13, 7:30 AM

Hi Davide, for SSL setup openerp-server.conf file what are the extra lines are add? in both openerp-server.conf? or any one. Code Updated

on 5/24/13, 9:28 AM

OpenERP doesn't provide any SSL support, so you don't need to touch the config file.

Davide Corio
on 5/24/13, 1:01 PM

Please see the updated code

on 5/27/13, 5:07 AM

look at the configuration i posted previously. you can use it "as is" by just changing the ip of your server.

Davide Corio
on 5/27/13, 5:20 AM

Yes perviously posted also used changed ip address <VirtualHost *:80>

ServerName openerpserver RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}


<VirtualHost *:443> ServerName openerpserver

RewriteEngine on RewriteRule ^/(.*) http://192.168.xx.xx:8069/$1 [P] ProxyPassReverse / http://192.168.xx.xx:8069/

SSLEngine On SSLCertificateFile /etc/apache2/ssl/server.crt SSLCertificateKeyFile /etc/apache2/ssl/server.key

</VirtualHost> But facing the same issue https:// redirect into http://

on 5/27/13, 5:44 AM

Davide Corio You are my HERO! Your pastebin example on May 24 '13 was the answer I have spent many hours looking for. Lots of nginx setup routines...with Apache there's an assumption of knowledge...hard for those who don't know. Thanks Davide!

on 7/29/13, 6:16 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 5/24/13, 6:32 AM
Seen: 12381 times
Last updated: 3/7/17, 9:35 AM