ctenuun
(Tenuun Ch)
September 28, 2021, 6:25am
#1
I have increased odoo from threaded mode to workers = 9 to improve stability issues when there is lot of users. Now it is working perfectly but odoo chat is not being redirected on apache.
i found redirect in /etc/httpd/conf.d/ssl.conf to 8069 but missing 8072 which is longpolling port for odoo chat.
How do i implement this without messing up default bahmni ssl setup by the installer ?
ProxyPass /longpolling/ http://localhost:8072/longpolling/ retry=0
ProxyPassReverse /longpolling/ http://localhost:8072/longpolling/ retry=0
ProxyPass / http://localhost:8069/ retry=0
ProxyPassReverse / http://localhost:8069/ retry=0
angshuonline
(Angshuman Sarkar)
September 28, 2021, 7:01am
#2
you can create another conf file specifically for odoo
you will notice that there is a rewrite rule in ssl.conf to a particular port. you would need to define another routing similarly
ctenuun
(Tenuun Ch)
September 28, 2021, 10:50am
#3
So this is the lines i have pinned down
/opt/bahmni-web/etc/ssl.conf
#erp-ssl
RewriteCond %{HTTP_HOST} ^openerp.(.)
RewriteRule (. ) http://localhost:8069$1 [P]
it seems the whole directory is passed to localhost:8069
I now need to [P] pass erp.hospital.domain/longpolling to localhost:8072 which i have no idea how.
Can anyone help solve this issue ? can we replace this whole block with proxy rule instead of mod_rewrite? I have no experience in rewriteCond or rules and since [P] is essentialy porxyPass
such as
ProxyPreserveHost On
ProxyPass /longpolling/ http://localhost:8072/longpolling/ retry=0
ProxyPassReverse /longpolling/ http://localhost:8072/longpolling/ retry=0
ProxyPass / http://localhost:8069/ retry=0
ProxyPassReverse / http://localhost:8069/ retry=0
ctenuun
(Tenuun Ch)
September 28, 2021, 12:10pm
#4
After dozen tries i should giveup and ask for proper help.
what am i not getting here ?
RewriteCond %{REQUEST_URI} ^/longpolling/*
RewriteRule (.*) http://localhost:8072$1 [P]
ctenuun
(Tenuun Ch)
October 4, 2021, 7:35am
#5
please help
after much trail i was not able to make longpolling for ODOO chat available in bahmni setup.
curl http://localhost:8072 returns just fine.
how do i rewrite https://sub .domain.tld/longpolling/ to http://localhost:8072
below setup seems to redir domain.tld/longpolling to http://locahost:8072
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/openmrs/*
RewriteCond %{HTTP_COOKIE} ^.JSESSIONID=([^;]+)
RewriteRule ^. $ - [CO=reporting_session:%1:%{HTTP_HOST}:86400:/:true:true]
RequestHeader set “X-Forwarded-Proto” “https”
#erp-ssl
RewriteCond %{HTTP_HOST} ^openerp.(.)
RewriteRule (. ) http://localhost:8069$1 [P]
RewriteCond %{REQUEST_URI} ^/longpolling/*
RewriteRule (.*) http://localhost:8072$1 [P]
#https rules for authentication
ProxyPass /go http://localhost:8153/go
ProxyPassReverse /go http://localhost:8153/go
Alias /bahmni /var/www/bahmniapps
Alias /document_images /home/bahmni/document_images
Alias /bahmni_config /var/www/bahmni_config
Alias /implementation_config /var/www/implementation_config
Alias /bahmni_revisions /var/www/bahmni_revisions
Alias /uploaded_results /home/bahmni/uploaded_results
Alias /uploaded-files /home/bahmni/uploaded-files
Redirect permanent /home /bahmni/home/
WSGIDaemonProcess client_side_logging user=apache group=apache threads=1
WSGIScriptAlias /log /var/www/client_side_logging/client_side_logging.wsgi
<Directory /var/www/client_side_logging>
WSGIProcessGroup client_side_logging
WSGIApplicationGroup %{GLOBAL}
Require all granted
gsluthra
(Gurpreet Luthra)
October 5, 2021, 7:07am
#6
I am not sure how to solve your exact problem. Maybe this Proxy rules file can guide you to the right path? It is the docker proxy file by @MekomSolutions that directs Bahmni calls to the right sub-system.
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$
RewriteRule (.*) /bahmni/home [R=301,L]
# OpenELIS
ProxyPass /openelis http://openelis:8080/openelis
ProxyPassReverse /openelis http://openelis:8080/openelis
# OpenMRS
ProxyPass /openmrs http://openmrs:8080/openmrs
ProxyPassReverse /openmrs http://openmrs:8080/openmrs
# Bahmni Apps
# Bahmni Apps requires to lookup the server date. Redirecting calls to "cgi-bin/systemdate".
ProxyPass /cgi-bin/systemdate http://bahmniapps:8900/cgi-bin/systemdate
ProxyPass /bahmni http://bahmniapps:8900
ProxyPassReverse /bahmni http://bahmniapps:8900
# Bahmni Config
ProxyPass /bahmni_config http://bahmni-config:8901
This file has been truncated. show original
And two additional links on longpolling Odoo:
Odoo 10 CE - chat is not refreshing on SSL connection | Odoo
postgresql - Odoo &NGINX: Polling process can't connect to DB over a NGINX reverse proxy - Stack Overflow
1 Like
mupagasi
(Mupagasi Jean Paul)
June 23, 2022, 9:17am
#7
Hello @MekomSolutions ,
Thanks for the sample config for proxy,
Could you advice how to do reverse proxy for odoo to accessible on path like /web or /odoo instead of port 8069?
Cc: @gsluthra and @angshuonline