콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4 답글
37075 화면

Hi,

Please, Is there a way to get configure https for Odoo.

for example:

instead of using the syntax: http: // server-IP: 8069, I use https: // server-IP: 8069

Thanks.

아바타
취소

Thank you @zbik for your help

베스트 답변

Example apache configuration:

<VirtualHost your.domain:443>
ServerName your.domain
SSLProxyEngine on
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/your.domain.crt
SSLCertificateKeyFile /etc/apache2/ssl/your.domain.key
SSLCACertificateFile /etc/apache2/ssl/your.domain.crt
RequestHeader set "X-Forwarded-Proto" "https"
SetEnv proxy-nokeepalive 1
ProxyPass / http://127.0.0.1:8069/
ProxyPassReverse / http://127.0.0.1:8069/
ProxyErrorOverride off
#TransferLog /var/log/apache2/transfer.your.domain.log
#Fix IE problem (httpapache proxy dav error 408/409)
SetEnv proxy-nokeepalive 1
</VirtualHost>




아바타
취소

Thank you its fixed login redirect to http problem. Also enabled headers module of Apache with command "a2enmod headers".

RequestHeader set "X-Forwarded-Proto" "https"

I tried the same configuration file you wrote here with my odoo service but when I check with:
"curl -ILk http://<my_ip>:<my_port>"
it still goes to location:
"http://<my_ip>:<port>/web/login"
instead of
"https://<my_ip>:<port>/web/login"

Can you please help me, what can be the issues

I also tried with this documentation here: https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-apache-in-ubuntu-20-04#step-4-redirecting-http-to-https

then actually it works very well and perfect if I check it like
"curl -ILk http://<my_ip>:80" it goes to Location: https://<my_ip>/

But again the problem is, this same thing doesnt work with odoo service's xmlrpc_port

베스트 답변

You will have to generate your own SSL certificate or buy one.

You will get/receive two files, a *.pem and a private one *.key. Move the files to locations bellow.

For NGINX:

Add these lines in your server section:

server {
listen 443;
ssl on;
ssl_certificate /etc/ssl/certs/your.pem;
ssl_certificate_key /etc/ssl/private/your.private.key;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;

...

}

If you really want to listen on 8069, change above 443 to 8069.

아바타
취소
작성자

Thank you @Carlos

can u give details step by step for http to https

베스트 답변

I'm getting an error message for 

RequestHeader
아바타
취소
베스트 답변

you could use certbot by EFF. they will easily generate the SSL certificate for you so that you dont have to worry anymore.

아바타
취소