Creating Nginx Virtual Hosts Rumi, May 20, 2017 Step One— Create a New Directory The first step in creating a virtual host is to a create a directory where we will keep the new website’s information. This location will be your Document Root in the nginx virtual configuration file later on. By adding a -p to the line… Continue Reading
Tuning Nginx for Maximum Performance Rumi, May 13, 2017May 13, 2017 Worker_processes Make sure you use the correct amount of worker_processes in your /etc/nginx/nginx.conf. This should be equal to the amount of CPU cores in the output of cat /proc/cpuinfo | grep processor root@server1:~# cat /proc/cpuinfo | grep processor processor : 0 processor : 1 processor : 2 processor : 3… Continue Reading
413 Request Entity Too Large Rumi, June 9, 2016 If you’re getting 413 Request Entity Too Large errors trying to upload with nginx.net/, you need to increase the size limit in nginx.conf . Add ‘client_max_body_size xxM’ inside the server section, where xx is the size (in megabytes) that you want to allow. http { include mime.types; default_type application/octet-stream; sendfile… Continue Reading
Nginx- Allow Directory browsing Rumi, March 20, 2016 Enabling directory listing in a folder in nginx is simple enough with just an autoindex on;directive inside the location directive. You can also enable sitewide directory listing by putting it in the server block or even enable directory access for all sites by putting it in the http block. An… Continue Reading
Reverse Proxy with Caching Rumi, February 15, 2016 A Sample Nginx Reverse proxy configuration- an alternative to Varnish cache (kind of more simplistic)- user www-data; worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { proxy_cache_path /cache levels=1:2 keys_zone=STATIC:10m inactive=24h max_size=1g; server { location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_cache STATIC; proxy_cache_valid… Continue Reading
Increase file upload size limit in PHP-Nginx Rumi, June 9, 2014 To change max file upload size to 100MB Edit… vim /etc/php5/fpm/php.ini Set… upload_max_filesize = 100M post_max_size = 100M Continue Reading
Nginx wordpress fancy URL or permalink fixing Rumi, November 12, 2013 If your wordpress is installed in the root directory i.e. yourdomain.com, you can use the following directives- location / { try_files $uri $uri/ /index.php?$args; } # Add trailing slash to */wp-admin requests. rewrite /wp-admin$ $scheme://$host$uri/ permanent; location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ { expires max; log_not_found off; } Or if your wordpress is… Continue Reading
Install nginx using yum on CentOS or SL Linux Rumi, October 25, 2013 Step #1: Install nginx repo Type the following wget command to install nginx yum configuration file: # cd /tmp CentOS Linux v6.x user type the following command: # wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm # rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm RHEL v6.x user type the following command: # wget http://nginx.org/packages/rhel/6/noarch/RPMS/nginx-release-rhel-6-0.el6.ngx.noarch.rpm # rpm -ivh nginx-release-rhel-6-0.el6.ngx.noarch.rpm Continue Reading
Mercury on Ubuntu 10.04 (Lucid) Rumi, December 22, 2012December 22, 2012 This high performance Drupal system is based on the work of Project Mercury. Project Mercury aims to increase the performance and ability of Drupal powered websites to respond to increased load. This document leverages the same collection of popular open source tools including the Varnish Accelerating Proxy, the APC bytecode… Continue Reading
Install nginx on virtualmin (GPL) server Rumi, August 26, 2012 Installing Nginx Support Switching a system from the Apache webserver (installed by default by Virtualmin to Nginx should only be done if no virtual servers with websites have been created yet. Ideally the change should be done on a freshly installed system, running RHEL 6.0, CentOS 6.0 or Debian 6.0… Continue Reading