Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

How To Reload Configuration File Of Nginx Server?

Answer»

You can RELOAD NGINX configuration FILE by running this COMMAND: nginx -­s reload

You can reload Nginx configuration file by running this command: nginx -­s reload

2.

How To Reopening The Log Files In Nginx Server?

Answer»

You can USE NGINX –s REOPEN

You can use nginx –s reopen

3.

What Is The Difference Between Nginx And Apache?

Answer»

Nginx :

  • Nginx is an event based web server
  • All request are handled by a single thread.
  • Nginx avoids child processes idea.
  • Nginx resembles speed
  • Nginx is better when it comes to memory consumption and CONNECTION
  • Nginx is better when you want load-balancing
  • For PHP, Nginx might be preferable as it supports PHP INTERNALLY
  • Nginx do not support O.S like IBMi and OpenVMS.
  • Nginx comes only with core FEATURES
  • Nginx performance and scalability do not depend on hardware

 Apache:

  • Apache is a process based server
  • Single thread handles a single request.
  • Apache is based on child processes
  • Apache resemble power
  • Apache is not up-to the mark when it comes to memory consumption and connection
  • Apache will refuse new connections when traffic reaches the limit of processes
  • Apache support’s PHP, Python, Perl and other LANGUAGES using plugins. It is useful when application is based on Python or Ruby
  • Apache support much wider range of O.S
  • Apache provides lot more functionality than Nginx
  • Apache is dependent on hardware components like CPU and memory

Nginx :

 Apache:

4.

Define Some Special Features Of Nginx?

Answer»

Special features of the Nginx server includes :

  • Reverse proxy/ L7 Load Balancer
  • EMBEDDED Perl INTERPRETER
  • On the fly BINARY upgrade
  • Useful for re­writing URLs and awesome PCRE support

Special features of the Nginx server includes :

5.

In Nginx How You Can Prevent Processing Requests With Undefined Server Names?

Answer»

A server that just drops the REQUESTS can be defined as Server
{
listen 80;
server_name “ “ ;
return 444;
}
Here the server name is kept as an EMPTY string which will match request without the “Host” header FIELD, and a SPECIAL Nginx’s non­standard code 444 is RETURNED that terminates the connection.

A server that just drops the requests can be defined as Server
{
listen 80;
server_name “ “ ;
return 444;
}
Here the server name is kept as an empty string which will match request without the “Host” header field, and a special Nginx’s non­standard code 444 is returned that terminates the connection.

6.

Explain How Nginx Can Handle Http Requests?

Answer»

Nginx uses the reactor pattern. The MAIN event loop WAITS for the OS to signal a readiness event­ such that the DATA is accessible to read from a SOCKET, at which INSTANCE it is read into the buffer and processed. A Single thread can serve tens of thousands of simultaneous connections.

Nginx uses the reactor pattern. The main event loop waits for the OS to signal a readiness event­ such that the data is accessible to read from a socket, at which instance it is read into the buffer and processed. A Single thread can serve tens of thousands of simultaneous connections.

7.

Explain How To Add Modules In Nginx Server?

Answer»

During the COMPILATION PROCESS, Nginx modules must be selected as such runtime SELECTION of modules is not SUPPORTED by Nginx.

During the compilation process, Nginx modules must be selected as such runtime selection of modules is not supported by Nginx.

8.

Explain How You Can Get The Current Time In Nginx?

Answer»

To GET the CURRENT TIME in Nginx, you have to use VARIABLES from SSI module, $date_gmt and $date_local. 

Proxy_set_header THE­TIME $date_gmt;

To get the current time in Nginx, you have to use variables from SSI module, $date_gmt and $date_local. 

Proxy_set_header THE­TIME $date_gmt;

9.

Explain Does Nginx Support Compress The Request To The Upstream?

Answer»

You can COMPRESS the request to the upstream by using the Nginx module GUNZIP. The gunzip module is a filter that decompresses responses with “CONTENT Encoding: gzip” for clients or SERVERS that do not support “gzip” encoding method.

You can compress the request to the upstream by using the Nginx module gunzip. The gunzip module is a filter that decompresses responses with “Content Encoding: gzip” for clients or servers that do not support “gzip” encoding method.

10.

What Is The Use Of Stub_status And Sub_filter Directives?

Answer»
  • Stub_status directive: This directive is used to KNOW the current status of Nginx like current active connection, total connection accepted and HANDLED current number of read/write/wait connection 
  • Sub_filter directive: It is used to SEARCH and replace the content in response, and quick fix for stale data

11.

What Is C10k Problem?

Answer»

C10K problem is REFERRED for the network socket unable to handle a LARGE NUMBER of CLIENT (10,000) at the same TIME.

C10K problem is referred for the network socket unable to handle a large number of client (10,000) at the same time.

12.

What Is Ngx_http_upstream_module Is Used For?

Answer»

The ngx_http_upstream_module is used to define groups of SERVERS that can REFERENCE by the fastcgi PASS, proxy pass, uwsgi pass, memcached pass and SCGI pass directives.

The ngx_http_upstream_module is used to define groups of servers that can reference by the fastcgi pass, proxy pass, uwsgi pass, memcached pass and scgi pass directives.

13.

In Nginx, Explain How You Can Keep Double Slashes In Urls?

Answer»

To keep DOUBLE slashes in URLs you have to use merge_slashes_off;
Syntax: merge_slashes [on/off]
DEFAULT: merge_slashes on
Context: http, SERVER

To keep double slashes in URLs you have to use merge_slashes_off;
Syntax: merge_slashes [on/off]
Default: merge_slashes on
Context: http, server

14.

Explain Is It Possible To Replace Nginx Errors Like 502 Error With 503?

Answer»

502= BAD gateway
503= Server overloaded
Yes, it is POSSIBLE but you to ensure that fastcgi_intercept_errors is set to ON, and use the ERROR page DIRECTIVE.

Location /
{
fastcgi_pass 127.0.01:9001;
fastcgi_intercept_errors on;
error_page 502 =503/error_page.html;
#…
}

502= Bad gateway
503= Server overloaded
Yes, it is possible but you to ensure that fastcgi_intercept_errors is set to ON, and use the error page directive.

Location /
{
fastcgi_pass 127.0.01:9001;
fastcgi_intercept_errors on;
error_page 502 =503/error_page.html;
#…
}

15.

What Is The Master And Worker Processes In Nginx Server?

Answer»

16.

Mention What Is The Best Usage Of Nginx Server?

Answer»

The best usage of NGINX server is to deploy DYNAMIC HTTP content on a network with USING SCGI, WSGI APPLICATION servers, FastCGI handlers for SCRIPTS. It can also serve as a load balancer.

The best usage of Nginx server is to deploy dynamic HTTP content on a network with using SCGI, WSGI application servers, FastCGI handlers for scripts. It can also serve as a load balancer.

17.

What Is The Advantage Of Using A “reverse Proxy Server”?

Answer»

The reverse proxy SERVER can hide the presence and characteristics of the origin server. It acts as an intermediate between internet CLOUD and web server. It is GOOD for security reason especially when you are using web hosting SERVICES.

The reverse proxy server can hide the presence and characteristics of the origin server. It acts as an intermediate between internet cloud and web server. It is good for security reason especially when you are using web hosting services.

18.

How To Add Modules In Nginx Server?

Answer»

19.

What Is The Purpose Of –s With Nginx Server?

Answer»

-s PARAMETER is used to RUN the EXECUTABLE file of nginx.

-s parameter is used to run the executable file of nginx.

20.

What Are The Controls Used In Nginx Server?

Answer»

NGINX ­s [STOP | QUIT | REOPEN | RELOAD]

Nginx ­s [stop | quit | reopen | reload]

21.

Where The Process Id Does For Nginx Server?

Answer»

The PROCESS ID of the MASTER process is WRITTEN in the FILE /usr/local/nginx/logs/nginx.pid

The process ID of the master process is written in the file /usr/local/nginx/logs/nginx.pid

22.

Explain How You Can Start Nginx Through A Different Port Other Than 80?

Answer»

To start Nginx through a DIFFERENT port, you have to go to /etc/Nginx/sitesenabled/ and if this is the default FILE, then you have to OPEN file CALLED “default.” Edit the file and put the port you WANT 
Like server { listen 81; }

To start Nginx through a different port, you have to go to /etc/Nginx/sitesenabled/ and if this is the default file, then you have to open file called “default.” Edit the file and put the port you want 
Like server { listen 81; }

23.

What Are All Feature Of Nginx Server?

Answer»
  • Ability to handle more than 10,000 simultaneous connections with a low memory.
  • Handling of static files, index files, and auto­indexing 
  • Reverse proxy with CACHING
  • Load balancing with in­band health checks
  • Fault tolerance
  • TLS/SSL with SNI and OCSP stapling SUPPORT, via OpenSSL.
  • FastCGI, SCGI, uWSGI support with caching
  • FastCGI via PHP (PHP­FPM) support with caching
  • Name­ and IP address­based virtual servers
  • IPv6­compatible
  • SPDY protocol support 
  • WebSockets and HTTP/1.1 Upgrade (101 Switching Protocols)
  • FLV and MP4 streaming
  • Web page access authentication
  • gzip compression and decompression
  • URL rewriting
  • Custom logging with on­the­fly gzip compression
  • Response rate and concurrent requests limiting
  • Server Side Includes
  • IP address­based Geo­Location
  • User tracking
  • WebDAV
  • XSLT data processing
  • Embedded Perl scripting
  • TLS/SSL support
  • STARTTLS support
  • SMTP, POP3, and IMAP proxy
  • Authentication using an external HTTP server
  • Upgrading EXECUTABLE and configuration without client connections loss and a module­based architecture.

24.

What Are Features Of Nginx?

Answer»

25.

What Is The Difference Between Apache Web Server And Nginx?

Answer»

Nginx uses an asynchronous event approach to HANDLING MULTIPLE requests whereas Apache Web Server USE the synchronous. Nginx’s event­driven approach can provide more predictable performance under high LOADS
Apache Web Server handling multiple request
|—­A—–||—–B———–||——­C——|
Nginx handling multiple request
|—­A—–|
|—–B———–|
|——­C——|

In this WAY, Nginx is far better than Apache.

Nginx uses an asynchronous event approach to handling multiple requests whereas Apache Web Server use the synchronous. Nginx’s event­driven approach can provide more predictable performance under high loads. 
Apache Web Server handling multiple request
|—­A—–||—–B———–||——­C——|
Nginx handling multiple request
|—­A—–|
|—–B———–|
|——­C——|

In this way, Nginx is far better than Apache.

26.

What Is The Best Usage Of Nginx Server?

Answer»

Nginx can deploy dynamic HTTP content on a network with using of SCGI,FASTCGI HANDLERS for scripts, WSGI application servers or Phusion Passenger module. Nginx can also SERVE as a LOAD balancer.

Nginx can deploy dynamic HTTP content on a network with using of SCGI,FastCGI handlers for scripts, WSGI application servers or Phusion Passenger module. Nginx can also serve as a load balancer.

27.

When Nginx’s Stable Version Launched?

Answer»

5 AUGUST 2014

5 August 2014

28.

What Is Official Website Of Nginx?

Answer»

nginx.org

nginx.org

29.

In Which Language Nginx Is Written?

Answer»

CLANGUAGE.

‘C’ Language.

30.

Who Is Author Of Nginx?

Answer»

IGOR Sysoev

Igor Sysoev

31.

What Is Nginx Server?

Answer»

Nginx is an OPEN source WEB server and a reverse proxy server for HTTP,SMTP, POP3, and IMAP protocols with a strong focus on high concurrency,PERFORMANCE and low memory usage. It is pronounced as “engine x”.

Nginx is an open source web server and a reverse proxy server for HTTP,SMTP, POP3, and IMAP protocols with a strong focus on high concurrency,performance and low memory usage. It is pronounced as “engine x”.