nginx的配置
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# http -> https
server {
listen 80;
server_name bot.shnyn.com;
rewrite ^(.*) https://$host$1 permanent;
}
server {
listen 443 ssl;
server_name bot.shnyn.com;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
# SSL parameters
ssl_certificate /etc/nginx/cert/odoo.com_bundle.crt;
ssl_certificate_key /etc/nginx/cert/odoo.com.key;
ssl_session_timeout 30m;
ssl_protocols TLSv1.2;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-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/bot.odoo.access.log;
error_log /var/log/nginx/bot.odoo.error.log;
proxy_set_header X-Forwarded-Proto https;
# Redirect websocket requests to odoo gevent port
location /websocket {
proxy_pass http://127.0.0.1:8072;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
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;
}
# Redirect requests to odoo backend server
location / {
# 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;
proxy_redirect off;
proxy_pass http://127.0.0.1:8069;
}
# common gzip
gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
gzip on;
}
odoo.conf的配置
[options]
; This is the password that allows database operations:
admin_passwd = Admin
db_host = 127.0.0.1
db_port = 5432
db_user = odoo
db_password = odoo
gevent_port = 8072
http_port = 8069
xmlrpc_interface = 127.0.0.1
netrpc_interface = 127.0.0.1
max_cron_threads = 1
workers = 4
logfile = /home/odoo/odooce/csdemo/log/odoo.log
log_level = debug
;server_wide_modules = web
addons_path = /home/odoo/odooce/odoo/addons,/home/odoo/odooce/addons,/home/odoo/odooce/csdemo/addons,/home/odoo/odooce/aibi/addons
data_dir = /home/odoo/odooce/csdemo/data
db_maxconn = 64
;osv_memory_age_limit = 1.0
;osv_memory_count_limit = False
; comma-separated list of dbs
dbfilter = ^(csdemoce|odoodev)$
proxy_mode=True
server_wide_modules = base, web,queue_job
[queue_job]
channels = root:2
网友评论