How to setup Nginx for Odoo?
By Technaureus Info Solutions Pvt. Ltd.,

  Category: Server     Comments: 2

NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server.

NGINX is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.

How to improve the performance of odoo using Nginx?

As Nginx is a well known high performance load balancer. By installing and configuring Nginx in server, we can boost the odoo performance. Below are the steps to install Nginx.

Step 1: Stop the Apache server.
This is better to stop the apache server while installing nginx to avoid any errors.

sudo service apache2 stop

Step 2: Install Nginx.

sudo apt-get install nginx

Step 3: Update the Nginx Config file.

Edit the Nginx main configuration file with a text editor and insert the following block after the line which specifies Nginx document root location.

sudo vim /etc/nginx/sites-enabled/default

Add the below code to specify the location:

location / {
proxy_pass http://127.0.0.1:8069;
proxy_redirect off;
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 $scheme;

Comment the existing location code as below:

#location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#       try_files $uri $uri/ =404;
#}

nginx_odoo_technaureus

Now test the configuration with the command nginx -t

If it returns no error, then restart the Nginx.

Step 4: Restart Nginx.

Just run getenforcecommand to check if Selinux in enabled on your machine or not. If it views like enable, disable it.

To completely disable Selinux, open /etc/selinux/config file with a text editor and set the line SELINUX to disabled.

sudo systemctl restart nginx

OR

sudo service nginx restart

Step 5: Restart Apache.

sudo service apache2 restart

 

2
Leave a Reply

avatar
2 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
0 Comment authors
Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
trackback

[…] erp with our domain name without mentioning any port number like mydomain.com. To do so, we have to setup nginx reverse proxy server in our odoo hosting […]

trackback

[…] we setup the nginx reverse proxy, if we mention the ipv4 address against ‘server_name’ will helps to run the odoo on […]

shares