跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

  1. 主页
  2. 版块
  3. Odoo 开发与实施交流
  4. 最新odoo12 nginx反向代理

最新odoo12 nginx反向代理

已定时 已固定 已锁定 已移动 Odoo 开发与实施交流
1 帖子 1 发布者 800 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • M 离线
    M 离线
    mysterisc
    写于 最后由 编辑
    #1

    如下图,nginx设置proxy_set_header后,会出现

    2019-02-02 16:00:11,698 141152 WARNING goodman odoo.http: No CSRF validation token provided for path '/web/login'
    
    Odoo URLs are CSRF-protected by default (when accessed with unsafe
    HTTP methods). See
    https://www.odoo.com/documentation/12.0/reference/http.html#csrf for
    more details.
    
    * if this endpoint is accessed through Odoo via py-QWeb form, embed a CSRF
      token in the form, Tokens are available via `request.csrf_token()`
      can be provided through a hidden input and must be POST-ed named
      `csrf_token` e.g. in your form add:
    
          <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
    
    * if the form is generated or posted in javascript, the token value is
      available as `csrf_token` on `web.core` and as the `csrf_token`
      value in the default js-qweb execution context
    
    * if the form is accessed by an external third party (e.g. REST API
      endpoint, payment gateway callback) you will need to disable CSRF
      protection (and implement your own protection if necessary) by
      passing the `csrf=False` parameter to the `route` decorator.
                         
    2019-02-02 16:00:11,701 141152 WARNING goodman odoo.addons.website.models.ir_ui_view: Could not find view object with xml_id 'website.400'
    

    且无法登陆进去
    proxy_set_header配置为

    proxy_set_header Host $host;
    proxy_set_header X–Real–IP $remote_addr;
    proxy_set_header X–Forwarded–For $proxy_add_x_forwarded_for;
    proxy_set_header X–Forwarded–Proto $scheme;
    

    如果把proxy_set_header注释掉,nginx反向代理就可以访问,但是一修改头像就会提示 连接已丢失...重新连接,无法修改,而且没有修改头所有发送的连接仍是localhost或者是ip地址

    1 条回复 最后回复
    0

    • 登录

    • 没有帐号? 注册

    • 登录或注册以进行搜索。
    • 第一个帖子
      最后一个帖子
    0
    • 版块
    • 标签
    • 热门
    • 用户
    • 群组