Category Archives: Nginx

Nginx – Redirect a specific url

A client wants the old .aspx path could redirect the visitor to another URL. I don’t want to make the server to host a .aspx file so i add the redirection in the Nginx virtual host config.

Add the following lines insider the server { … }.

## Special redirect for the following
## old xxx.aspx to eureka.ykyuen.info
location /xxx.aspx {
  return 301 $scheme://eureka.ykyuen.info;
}

 

Done =)

Nginx – Setup HTTP Authentication

HTTP Authentication is the easiest way to prevent anonymous user access to your website. If you are on Apache, you can refer to the following post.
.htaccess – Setting Password For Your Web Folder

After you have created the password file, you could add the following line in the .htaccess or in the Apache VirtualHost.
Continue reading Nginx – Setup HTTP Authentication

Run Drupal 7 in Nginx

After so many days we have talked about setting up Nginx, PHP-FPM, MariaDB and some PHP caching. We can now try to run a Drupal instance on them. Before we starts, let me listed out all the previous posts.

 

It’s time to start the Drupal installation.
Continue reading Run Drupal 7 in Nginx

Nginx – Enable Microcaching

Update @ 2013-05-09: I am not very sure if this could really enable the Nginx Microcaching as i couldn’t find the HIT value in the HTTP response. Please feel free to comment and let us know if you got the solution. Thanks. =D

Previous posts:

 

Enable Microcaching in Nginx could help making your website run much faster. Base on the setting we did in Nginx + PHP-FPM on Ubuntu Precise. Let’s edit the VirtualHost configuration file to enable Microcaching.
Continue reading Nginx – Enable Microcaching

Nginx + PHP-FPM on Ubuntu Precise

Previous post: Nginx – Installation on Ubuntu Precise

Most of the time we would like to run PHP on our web server. After you have installed Nginx following the post above. We can now enable PHP.

1. Install the PHP packages.

apt-get install php5-fpm
apt-get install php5-cli
apt-get install php5-gd
apt-get install php-pear

Continue reading Nginx + PHP-FPM on Ubuntu Precise