Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
4 Odpowiedzi
9037 Widoki

Ok, I'm using Odoo 12 on Ubuntu 18.04, nginx/1.14.0 with letsencrypt for my ssl certs.

Most everything is working perfectly, however links from the website that redirect are returning the variable I named in the nginx domain config file instead of using the domain.

# Odoo servers
upstream odoo {
      server 127.0.0.1:8069;
}
upstream odoochat {
     server 127.0.0.1:8072;
}
# HTTP -> HTTPS
server {
      if ($host = www.qa.moddulu.com) {
            return 301 https://$host$request_uri;
      } # managed by Certbot
      if ($host = qa.moddulu.com) {
            return 301 https://$host$request_uri;
      } # managed by Certbot
      listen 80;
      server_name www.qa.moddulu.com qa.moddulu.com;
      include snippets/letsencrypt.conf;
      return 301 https://qa.moddulu.com$request_uri;
}
# WWW -> NON WWW
server {
      listen 443 ssl http2;
      server_name www.qa.moddulu.com;
      ssl_trusted_certificate /etc/letsencrypt/live/qa.moddulu.com/chain.pem;
      include snippets/ssl.conf;
      include snippets/letsencrypt.conf;
      return 301 https://qa.moddulu.com$request_uri;
      ssl_certificate /etc/letsencrypt/live/qa.moddulu.com/fullchain.pem; # managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/qa.moddulu.com/privkey.pem; # managed by Certbot
}
server {
      listen 443 ssl http2;
      server_name qa.moddulu.com;
      proxy_read_timeout 720s;
      proxy_connect_timeout 720s;
      proxy_send_timeout 720s;
      # Proxy headers
      proxy_set_header X-Forwarded-Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Real-IP $remote_addr;
      # SSL parameters
      ssl_trusted_certificate /etc/letsencrypt/live/qa.moddulu.com/chain.pem;
      include snippets/ssl.conf;
      include snippets/letsencrypt.conf;
      return 301 https://qa.moddulu.com$request_uri;

      ssl_certificate /etc/letsencrypt/live/qa.moddulu.com/fullchain.pem; # managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/qa.moddulu.com/privkey.pem; # managed by Certbot
}
server {
      listen 443 ssl http2;
      server_name qa.moddulu.com;
      proxy_read_timeout 720s;
      proxy_connect_timeout 720s;
      proxy_send_timeout 720s;
      # Proxy headers
      proxy_set_header X-Forwarded-Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Real-IP $remote_addr;
      # SSL parameters
      ssl_trusted_certificate /etc/letsencrypt/live/qa.moddulu.com/chain.pem;
      include snippets/ssl.conf;
      include snippets/letsencrypt.conf;
      # log files
      access_log /var/log/nginx/qa.moddulu.com.access.log;
      error_log /var/log/nginx/qa.moddulu.com.error.log;
      # Handle longpoll requests
      location /longpolling {
      proxy_pass http://odoochat;
}
# Handle / requests
location / {
      proxy_redirect off;
      proxy_pass http://odoo;
}
# Cache static files
location ~* /web/static/ {
      proxy_cache_valid 200 90m;
      proxy_buffering on;
      expires 864000;
      proxy_pass http://odoo;
}
# Gzip
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
gzip on;

ssl_certificate /etc/letsencrypt/live/qa.moddulu.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/qa.moddulu.com/privkey.pem; # managed by Certbot
}

so, for example, I'm trying to log in and and the url is going to 'https://odoo/web' instead of 'https://qa.moddulu.com/web'. the 'odoo' in the link changes with whatever the upstream variable for the server is. I haven't been able to find a solution to this. I've tried rebuilding the server, but that didn't fix the problem.

Awatar
Odrzuć

This is not an Odoo issue.

Autor

I'm still looking for help, if anyone can help me with this issue. I'm also using google to host.

Hi ,

I am facing the same issue and using google to host @Cristin Meravi did you ever find a solution?

Najlepsza odpowiedź

You should set proxy_mode = True on odoo config

Awatar
Odrzuć
Najlepsza odpowiedź

Hi, you can follow this: https://youtu.be/-3wV7A_4s-w

Hope it helps

Awatar
Odrzuć
Najlepsza odpowiedź

i dont think that is the only solution
must  be  something 
it  was  working  before 

Awatar
Odrzuć
Autor Najlepsza odpowiedź

Instead of using `upstream odoo` I used `upstream <domain name>`.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
maj 24
7826
3
maj 24
4663
1
lip 19
2575
4
gru 22
379