Skip to Content
Menu
This question has been flagged
2 Replies
13117 Views

Hello,

I'm setting up an Odoo 8.0 server behind a squid 3 reverse proxy.

The proxy conf is done like this:

Any request on port 80 is redirected to port 443.

Any request on port 443 is relayed on Odoo server's port 443.

 

Conf on the server :

nginx as a reverse proxy, not responding on port 80, rewriting request on port 443 to port 8069.

 

 

The problem is, when I enter the public URL, port 80, Odoo server keep responding in http, not in https.

If I'm on the Odoo server local network, everything is OK.

 

Any idea?

Thanks

Avatar
Discard
Best Answer

I faced the same problem and was able to fix it by simply removing

/ proxy_set_header    Host            $host;

Avatar
Discard

yep, comment #proxy_set_header Host $host;
It worked for me.

Best Answer

Here is my nginx conf. Maybe it will bee useful for you.

upstream oddo {
    server 127.0.0.1:8069;
}

server {
    listen      443 default;
    server_name 0.0.0.0;

    access_log  /var/log/nginx/oddo.access.log;
    error_log   /var/log/nginx/oddo.error.log;

    ssl on;
    ssl_certificate     /etc/nginx/ssl/server.crt;
    ssl_certificate_key /etc/nginx/ssl/server.key;
    keepalive_timeout   60;

    ssl_ciphers             HIGH:!ADH:!MD5;
    ssl_protocols           SSLv3 TLSv1;
    ssl_prefer_server_ciphers on;

    proxy_buffers 16 64k;
    proxy_buffer_size 128k;

    location / {
        proxy_pass  http://oddo;
        proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        proxy_redirect off;
        proxy_read_timeout 60m;

        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 https;
    }

    location ~* /web/static/ {
        proxy_cache_valid 200 60m;
        proxy_buffering on;
        expires 864000;
        proxy_pass http://oddo;
    }
}

server {
    listen      80;
    server_name 0.0.0.0;

    add_header Strict-Transport-Security max-age=2592000;
    rewrite ^/.*$ https://$host$request_uri? permanent;
}

 

Avatar
Discard
Related Posts Replies Views Activity
1
Aug 23
12544
1
Aug 23
11036
1
Jul 23
7218
4
Apr 23
8675
2
Feb 23
17588