Community: Framework mailing list archives

expert-framework@mail.odoo.com

Re: Need help to make OpenERP to use https

by
Danny W. Adair
- 11/27/2014 04:26:58
Hi,

we just put an nginx webserver in front of Odoo and proxy pass.
Here's a sample configuration, using snakeoil cert from the "ssl-cert" 
package on Ubuntu.

Installation:

================================================================
sudo apt-get install nginx
sudo apt-get install ssl-cert

sudo vi /etc/nginx/sites-available/odoo
(contents see below)

sudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/
sudo rm /etc/nginx/sites-enabled/default
sudo service nginx restart
================================================================

Just replace "<%=@fqdn%>" with the fully qualified domain name of your 
server:

================================================================
upstream odoo {
     server 127.0.0.1:8069;
}

server {
     listen      443 default;
     server_name <%=@fqdn%>;

     access_log  /var/log/nginx/odoo.access.log;
     error_log   /var/log/nginx/odoo.error.log;

     ssl on;
     ssl_certificate     /etc/ssl/certs/ssl-cert-snakeoil.pem;
     ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
     keepalive_timeout   60;

     ssl_ciphers             HIGH:!ADH:!MD5;
     ssl_protocols           SSLv3 TLSv1;
     ssl_prefer_server_ciphers on;

     proxy_buffers 16 64k;
     proxy_buffer_size 128k;

     client_max_body_size 100m;

     location / {
         proxy_pass  http://odoo;
         proxy_read_timeout 3600;
         proxy_connect_timeout 3600;
         proxy_next_upstream error timeout invalid_header http_500 
http_502 http_503 http_504;
         proxy_redirect off;

         proxy_set_header    Host            $host;
         proxy_set_header    X-Real-IP       $remote_addr;
         proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header    X-Forwarded-Proto https;
     }

     location ~* /web/static/ {
         proxy_cache_valid 200 60m;
         proxy_buffering on;
         expires 864000;
         proxy_pass http://odoo;
     }
}

server {
     listen      80;
     server_name <%=@fqdn%>;

     add_header Strict-Transport-Security max-age=2592000;
     rewrite ^/.*$ https://$host$request_uri? permanent;
}
================================================================

Cheers,
Danny


On 2014-11-27 22:17, Sivadasan E T wrote:
> Dear Sir,
>
> We are using OpenERP for our institution. At present http has been
> used as the protocol and would like to switch over to https. Please
> let us know the steps to convert http to https.
>
> --
>
> Thanks & Regards
>
> E.T. Sivadasan,
>
> Asso. Professor - CSE, Systems Manager,
> Vidya Academy of Science & Technology,
> "Progress Through Education"
>
> P.O. Thalakkottukara, Thrissur - 680 501
> Tel: +91 (4885) 287751, 287752, Ext. 142
> Website: www.vidyaacademy.ac.in [1]
>
> _______________________________________________
>  Mailing-List: https://www.odoo.com/groups/community-framework-62
>  Post to: mailto:expert-framework@mail.odoo.com
>  Unsubscribe: https://www.odoo.com/groups?unsubscribe
>
>
> Links:
> ------
> [1] http://www.vidyaacademy.ac.in/