This question has been flagged
2 Replies
32906 Views

I'm trying to set up a reverse proxy (in order to get SSL working on Windows - doesn't seem like there's any other way).

Trouble is that when I access https://foo (via the reverse proxy), OpenERP responds with a redirect to http://foo.

Setting

proxy_mode = True

does not make it leave the url alone like I'd hope. What is it supposed to do? How can I get it to not change the protocol?

Thanks

Avatar
Discard
Best Answer

Your problem is with the configuration od the web-server.

What are you using, nginx or apache2?

If you are using nginx:

upstream openerpweb {
#If the server is in other IP change localhost by the ip of openerp server
server localhost:8069 weight=1 max_fails=3 fail_timeout=30s;
#Just uncomment this line as many times as servers you have, remember change 
#the port
#server localhost:8069 weight=1 max_fails=3 fail_timeout=30s;}

server {
#If Apache is in the server change the port to avoid port conflicts.
listen 80;

###################################################################
#Here Hostname that will be called in the browser.
#Remember you should have 1.- DNS CNAME or 2.- edit your /etc/hosts
#with this name dns.example.com.
###################################################################
server_name    dns.example.com;
#Put name of instance replacing 'openerp'
#to be sure every instance manage its own log
access_log    /var/log/nginx/openerp-access-http.log;
error_log    /var/log/nginx/openerp-error-http.log;
#What will happen in root.
location / {
    proxy_pass    http://openerpweb;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
    # by default, do not forward anything
    proxy_redirect off;
    error_page 502 = /50x.html;
}
#How we will manage static files
location ~* /web/static {
    proxy_cache_valid 200 60m;
    send_timeout 200;
    proxy_read_timeout 200;
    proxy_connect_timeout 200;
    proxy_buffering    on;
    expires 864000;
    proxy_pass    http://openerpweb;
}
#webdav stuff
#TODO This doc
 location ~* /webdav {
    proxy_cache_valid 200 60m;
    send_timeout 200;
    proxy_read_timeout 200;
    proxy_connect_timeout 200;
    proxy_buffering    on;
    expires 864000;
    proxy_pass    http://openerpweb;
}
#When Server is down, change by our own 50x.html template
#A 50x template is the html shown when openerp server fails
location = /50x.html {
    root /usr/share/nginx/www;
}}

This is the config file to use.

If you have any doubt, just make an answer ;-)

Regards.

Avatar
Discard
Author

Hi, thank you for your response - but using IIS with ARR actually. Its possible the mistake is in my configuration there, but my question still stands - what does proxy_mode do?

Best Answer

According to this:

Enable correct behavior when behind a reverse proxy

proxy_mode = True

Avatar
Discard