≡ Menu

Nginx

7 Nginx Rewrite Rule Examples with Reg-Ex and Flags

Ability to change (rewrite) incoming URL into a different URL based on your criteria is an essential feature for any webserver. Nginx rewrite is very powerful and flexible. In this tutorial, we’ll explain the following examples on nginx rewrite: Nginx Rewrite Example Using $1, $2, .. Creating Controller File Using Nginx Rewrite Rewrite Break Flag [...]

{ 0 comments }

If you are running Nginx webserver, it is important for you to understand how the location directive works. Nginx uses location directive to decide what configuration it should apply based on prefix or the pattern in the incoming URL. For example, from what directory it should serve the image files when an URL ends with [...]

{ 1 comment }

You can use Nginx as a loadbalancer in front of your web application. For example, if your enterprise application is running on Apache (or Tomcat), you can setup an 2nd instance of your enterprise application on Apache (or Tomcat) on a different server. And then, you can put Nginx at the front-end, which will load [...]

{ 2 comments }

How to Setup Nginx Reverse Proxy to Apache/PHP on Linux

Nginx can be used as a front-end to an Apache/PHP website. For this, we need to setup Nginx as a reverse proxy. For example, let us say we have an enterprise application that is running on Apache and PHP on app.thegeekstuff.com, and we also have Nginx running on example.com. In this example scenario, when someone [...]

{ 2 comments }

What is SSI? SSI stands for Server Side Includes. As the name suggests, they are simple server side scripts that are typically used as directives inside html comments. Where to use SSI? There are several ways to SSI. The two most common reason to use SSI are to serve a dynamic content on your web [...]

{ 2 comments }

Typically you’ll see .php as the extension for PHP files that are served by a webserver. Sometimes you might also have a php file that has an extension other than .php, and in those cases, the webserver might not be able to serve that file. For discussion purpose, let us assume that you have written [...]

{ 1 comment }

How to Configure Nginx to Execute PHP Using PHP-FPM

Nginx is pronounced as “Engine-X”, which is a web server and reverse proxy server. Nginx is well known for its speed and ability to handle large number of requests simultaneously with optimal use of resources. PHP-FPM stands for “PHP-FastCGI process manager”. CGI refers to the common gateway interface which is scripted to work as a [...]

{ 4 comments }

Nginx Vs Apache: Nginx Basic Architecture and Scalability

The need for serving large number of concurrent requests is raising every day. The prediction of C10K problem (i.e 10,000 concurrent clients) started the research on web server architecture which could solve this problem. As a result Nginx architecture was developed. This article explains on a very high-level how Nginx works to solve the scalability [...]

{ 21 comments }