Odoo Help

1

Problem when forcing http to POS session

By
Yoshi Tashiro
on 11/13/14, 7:40 PM 1,833 views

I am trying to apply settings in Apache for my Odoo 8 environment to achieve:

- force http for POS interface (for using PosBox - PosBox does not work with https)

- force https for everything else

I can do this by mod_rewrite (e.g. "RewriteCond %{REQUEST_URI} ^/pos") except that the POS session just goes blank with an error in the log that says "Function declared as capable of handling request of type 'json' but called with a request of type 'http'".

It seems JSON message is not passing through.  How can I get rid of this problem?

This problem does not happen when you apply http for everything or https for everything, so I am guessing I need to tweak something in Apache settings, but I do not know how.  Any sample from handling the same requirement would help.

0
Yoshi Tashiro
On 1/15/15, 10:22 PM

Ok, I got it working now.  I just added "RewriteCond %{REQUEST_METHOD} !POST" under "<VirtualHost *:80>", which makes it look like:

<VirtualHost *:80>
        ServerName xxxx
        RewriteEngine On
        RewriteCond %{HTTPS} !=on
        RewriteCond %{REQUEST_URI} !^/pos
        RewriteCond %{REQUEST_METHOD} !POST
        RewriteRule ^/?(.*) https://%{HTTP_HOST}/$1 [R,L]

        ProxyPass / http://xxxx:8069/
        ProxyPassReverse / http://xxxx:8069/
</VirtualHost>

 

I was getting an error in Chrome Developer Tools that said "GET https://xxxx/web/session/get_session_info 400 (BAD REQUEST)", so adding the RewriteCond line for REQUEST_MOTHOD circumvented the issue.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 11/13/14, 7:40 PM
Seen: 1833 times
Last updated: 3/16/15, 8:10 AM