This question has been flagged
1 Reply
3569 Views

I have a odoo 11 installation behind a Nginx proxy. Its been working for a while but now when you access it, its showing index of / instead of Odoo login page (see screenshot). 


Here is my Nginx configuration:

#odoo server

upstream odoo {

 server 127.0.0.1:8069;

}

upstream odoochat {

 server 127.0.0.1:8072;

}


# http -> https

server {

   listen 80;

   server_name businessapps.enone.tech;

   #server_name odoo;

   rewrite ^(.*) https://$host$1 permanent;

}


server {

 listen 443;

 server_name businessapps.enone.tech;

 #server_name odoo;

 proxy_read_timeout 720s;

 proxy_connect_timeout 720s;

 proxy_send_timeout 720s;


 # Add Headers for odoo proxy mode

 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 on;

 ssl_certificate /etc/letsencrypt/live/businessapps.enone.tech/fullchain.pem;

 ssl_certificate_key /etc/letsencrypt/live/businessapps.enone.tech/privkey.pem;

 ssl_session_timeout 30m;

 ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

 ssl_ciphers '<replaced cipher>';

 ssl_prefer_server_ciphers on;


 # log

 access_log /var/log/nginx/odoo.access.log;

 error_log /var/log/nginx/odoo.error.log;


 # Redirect longpoll requests to odoo longpolling port

 location /longpolling {

   proxy_pass http://odoochat;

 }


 # Redirect requests to odoo backend server

 location / {

   proxy_redirect off;

   proxy_pass http://odoo;

 }


 # common gzip

 gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;

 gzip on;

}



Can someone point out what could be the issue.
Avatar
Discard
Best Answer

Hi,
Your Nginx configuration is not correct. There is a wrong value for proxy_pass, eg: proxy_pass http://127.0.0.1:8069/ and some other mistakes too.

Please refer this blog to configure your Nginx properly https://www.cybrosys.com/blog/how-to-configure-odoo-with-nginx-as-reverse-proxy

Hope it helps

Avatar
Discard