概要
用nginx配置实现,odoo15的代理端口在Ubuntu环境
1、odoo安装ok,本地可以运行
2、安装nginx
apt istall nginx
即可,这里磨蹭了好久,主要是没有确认nginx的配置文件一直搞不定
3、申请证书不懂的参考:“https://blog.csdn.net/u012798683/article/details/113845089”,安装这个哥哥的配置搞不定
4、参考官网的模式在 /etc/nginx/sites-enabled/odoo.conf配置ok:原文链接:https://www.odoo.com/documentation/14.0/zh_CN/administration/install/deploy.html
#odoo server
upstream odoo {
server 127.0.0.1:8069; #根据自己的端口修改
}
upstream odoochat {
server 127.0.0.1:8072; #根据自己的端口修改
}
http -> https
server {
listen 80;
server_name odoo.mycompany.com; #注意替换成自己的域名
rewrite ^(.*) https://$host$1 permanent;
}
server {
listen 443 ssl;
server_name odoo.mycompany.com; #根据自己的域名修改
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
Add Headers for odoo proxy mode
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
SSL parameters
ssl_certificate /etc/ssl/nginx/server.crt; #确认自己的证书路径
ssl_certificate_key /etc/ssl/nginx/server.key; #确认自己的证书路径
ssl_session_timeout 30m;
ssl_protocols TLSv1.2;
#ssl_ciphers 这里根据证书的要求填写华为云证书的是“HIGH:!aNULL:!MD5;”
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
log
access_log /var/log/nginx/odoo.access.log;
error_log /var/log/nginx/odoo.error.log;
Redirect longpoll requests to odoo longpolling port
location /longpolling {
proxy_pass http://odoochat;
}
Redirect requests to odoo backend server
location / {
proxy_redirect off;
proxy_pass http://odoo;
}
common gzip
gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
gzip on;
}文章来源:https://www.toymoban.com/news/detail-859662.html
5、nginx -t 确认配置ok
有错误的化根据提示修改,通常是找不到文件之类的或者直接bing搜索问题
6、重启就ok,ssl链接正常,重启验证ok官网文档最强还是。文章来源地址https://www.toymoban.com/news/detail-859662.html
到了这里,关于nginx配置odoo反向代理和ssl访问的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!