<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[pfSense and odoo and nginx: Error 502, bad Gateway]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">first: maybe this is a problem from odoo or nginx, but would be great if you can help me.</p>
<p dir="auto">The situation:<br />
LTE Router =&gt; pfsense (WAN) =&gt; pfsense (LAN) =&gt; odoo Server (Ubuntu server 16.04)</p>
<p dir="auto">The Problem:<br />
When I restart the LTE Router, I cannot connect the webservice over the internal network from the odoo Server with:<br />
https://portal.company.com<br />
Error 502, bad gateway.</p>
<p dir="auto">Temporary solution:<br />
restart odoo</p>
<p dir="auto">Now I want to fix this problem.</p>
<p dir="auto">My Setup in pfSense:<br />
odoo server: receive fixed IP via DHCP (192.168.0.202)<br />
DNS entry to reach the server in local network: https://portal.company.com<br />
Port Forwarding to reach the odoo server also from external</p>
<p dir="auto">My Setup in nginx:</p>
<pre><code>#worker_processes  1;

#events {
#    worker_connections  1024;
#}

        upstream portal.company.com {
                server portal.company.com:8069 weight=1 fail_timeout=0;
        }

        upstream portal.company.com-im {
                server portal.company.com:8072 weight=1 fail_timeout=0;
        }



        server {
        listen  80;
        server_name portal.company.com;

        location /socket.io {
#               proxy_buffer_size 128k;
                proxy_send_timeout 600s;
                proxy_read_timeout 600s;
                proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;

                proxy_pass   http://127.0.0.1:8068;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                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;
                proxy_redirect off;
        }

        location / {
                proxy_redirect off;
                proxy_pass http://portal.company.com;
        }

        location /longpolling {
                proxy_pass http://portal.company.com-im;
        }

        location /web/static/ {
                proxy_cache_valid 200 60m;
                proxy_buffering on;
                expires 864000;
                proxy_pass http://portal.company.com;
        }
 }

</code></pre>
<p dir="auto">Maybe someone can see the problem?</p>
<p dir="auto">Thank you!</p>
]]></description><link>https://forum.netgate.com/topic/154708/pfsense-and-odoo-and-nginx-error-502-bad-gateway</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 03:10:13 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/154708.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 22 Jun 2020 07:42:51 GMT</pubDate><ttl>60</ttl></channel></rss>