Odoo Help

Welcome!

This community 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.

1

Problem when forcing http to POS session

By
Yoshi Tashiro
on 11/13/14, 7:40 PM 1,493 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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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