odoo17配置文件示例

nginx配置文件

upstream odoo {
    server 127.0.0.1:8069;
}

upstream odoochat {
    server 127.0.0.1:8072;
}
map $http_upgrade $connection_upgrade {
  default upgrade;
  ''      close;
}

client_max_body_size 100M;

server {
    listen 80;
    listen [::]:80;
    server_name 17.xnb.me;

    # Redirect HTTPls requests to HTTPS
    rewrite ^(.*) https://$host$1 permanent;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name 17.xnb.me;
    #从上游服务器请求时间限制 
    proxy_read_timeout 720s;
    proxy_connect_timeout 720s;
    proxy_send_timeout 720s;

    # SSL Certificate
    ssl_certificate /etc/nginx/cert/17.xnb.me/cert.pem;
    ssl_certificate_key /etc/nginx/cert/17.xnb.me/key.pem;
    ssl_session_timeout 30m;
    ssl_protocols TLSv1.2;
    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;

  # Redirect websocket requests to odoo gevent port
  location /websocket {
    proxy_pass http://odoochat;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_set_header X-Forwarded-Host $http_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 settings
# Redirect requests to odoo backend server
  location / {
    # Add Headers for odoo proxy mode
    proxy_set_header X-Forwarded-Host $http_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://odoo;

    # Enable HSTS
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
    # requires nginx 1.19.8
    #proxy_cookie_flags session_id samesite=lax secure;
  }

    #deny out net
    location /web/database/manager {
        # 拒绝公网IP访问
        deny all;
        # 允许内网指定网段访问
        allow 192.168.1.0/24;
        allow 192.168.8.0/23;
        
        # 其他IP拒绝访问
        #deny all;
        # 拒绝公网IPv6访问
        #deny all;
        # 允许内网IPv6指定网段访问
        #allow 2001:db8::/32;
        # 其他IPv6拒绝访问
        #deny all;
    }

    # Common gzip settings
    gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
    gzip on;

    # Access and error logs
    access_log /var/log/nginx/17.xnb.me.access.log;
    error_log /var/log/nginx/17.xnb.me.error.log;
}

odoo配置文件

[options]
db_host = False
db_port = False
db_user = odoo
db_password = False
default_productivity_apps = True


#代理访问
http_port=8069
longpolling_port=8072
proxy_mode = True

# ; 工作进程
limit_memory_hard = 1677721600
limit_memory_soft = 629145600
limit_request = 8192
limit_time_cpu = 600
limit_time_real = 1200
max_cron_threads = 1
workers = 8

 

版权声明:
作者:xiaoniba
链接:https://blog.xiaoniba.com/2024/01/30/odoo17%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6%e7%a4%ba%e4%be%8b/
来源:小泥吧的博客
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>