zoukankan      html  css  js  c++  java
  • nginx * odoo, 速度提升

    1: sudo apt-get  install nginx

    2:  add server: 在/etc/nginx/sites-enabled 中增加一个可用的server。 文件如下图所示

    3:重启 nginx server生效

    4: 注意如果需要转发 的80端口, ngingx默认的配置是定义了80的server的,需要修改掉 /etc/nginx/sites-enabled/default 中的80端口定义才能,否则后面增加的server 80定义不能使用。

    本机端口转发的小例子,在/etc/nginx/sites-enabled目录中(注意一定是sites-enabled,因为sites-avialbe目录在配置文件中没有被include),增加一个配置文件openerp

    内容如下,nginx restart 后,则访问本机80端口的内容,就转发到http://xxx.xx.xx.xx:8069了。

    server{
      listen 80;
      server_name odoo9;
      location / {

        proxy_pass http://0.0.0.0:8069;

        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;
        
      }

      location /longpolling/ {  

            proxy_pass        http://localhost:8072/longpolling/;  

            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;

      }  


    }

    #############

    /etc/ningx/nginx.conf  开启所有  gzip 属性.

    # 使用多核配置

    oenerp-server.conf 需要修改一些参数:

    works = n                  #N为cpu 核数

    limit_time_cpu = 80000  # 这个参数需要调高,出现过太设置太低 导致 模块升级总是失败的情况

  • 相关阅读:
    Centos7 安装 mysql5.7
    python正则表达式---七七八八
    爬虫之英雄联盟
    爬虫之User-Agent
    爬虫之证书错误
    ubuntu windows双系统 删除Ubuntu后windows系统引导修复
    ubuntu系統桌面重置
    ubuntu安装qtcreator
    win10/ubuntu双系统----ubuntu有线无线都不能上网
    pyenv 安装
  • 原文地址:https://www.cnblogs.com/alangwansui/p/3927634.html
Copyright © 2011-2022 走看看