support Click to see our new support page.

How to setup Nginx for Odoo?

blog_img_55
Author

Technaureus Info Solutions Pvt. Ltd.April 28, 2018

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

 

Call to Action

If you're looking for expert guidance in choosing the right Software service for your business, feel free to reach out to us. Our team is here to assist you in making the best choice for your unique needs and objectives.

 

 

 

 

 

 

LinkedIn LinkedIn