Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common questions in Nginx interview?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what are the common topics in Nginx interviews". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and go deep into it slowly to study and learn "what are the common topics in Nginx interviews" together!

Please explain what Nginx is.

Nginx is a web server and directional proxy server for HTTP, HTTPS, SMTP, POP3 and IMAP protocols.

Please list some features of Nginx.

Nginx server features include:

Reverse Proxy/L7 Load Balancer

embedded Perl interpreter

dynamic binary upgrade

Can be used to rewrite URLs with very good PCRE support

Please list the differences between Nginx and Apache.

Please explain how Nginx handles HTTP requests.

Nginx uses reactor mode. The main event loop waits for the operating system to signal a ready event so that data can be read from the socket, read into the buffer in this instance, and processed. A single thread can provide tens of thousands of concurrent connections.

In Nginx, how do you use undefined server names to prevent requests from being processed?

Simply define the server requesting deletion as:

Server { listen 80; server_name " " ; return 444; }

Here, the server name is reserved as an empty string that will match the request without the "host" header field, and a special Nginx non-standard code 444 is returned, terminating the connection.

What are the advantages of using a reverse proxy server?

A reverse proxy server can hide the presence and characteristics of the origin server. It acts as an intermediate layer between the internet cloud and web servers. This is great for security, especially if you are using web hosting services.

7. Please list the *** purpose of Nginx server.

The *** usage of Nginx server is to deploy dynamic HTTP content on the network, using SCGI, WSGI application servers, FastCGI handlers for scripts. It can also act as a Load Balancer.

Please explain what the Master and Worker processes on the Nginx server are.

Master Process: Read and Evaluate Configuration and Maintenance

Worker Process: Process Request

Please explain how you can open Nginx on a port other than 80.

In order to open Nginx via a different port, you must go to/etc/Nginx/sites-enabled/, and if this is the default file, you must open a file named "default." Edit the file and place it in the port you want:

Like server { listen 81; }

Please explain if it is possible to replace Nginx errors with 502 errors or 503 errors.

502 = wrong gateway

503 = Server overload

Possibly, but you can make sure 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; #… }

In Nginx, explain how to keep double slashes in URLs.

To preserve double slashes in URLs, you must use merge_slashes_off;

Syntax:merge_slashes [on/off]

Default: merge_slashes on

Environment: http, server

What is ngx_http_upstream_module?

ngx_http_upstream_module is used to define groups of servers that can be referenced via fastcgi, proxy, uwsgi, memcached, and scgi delivery directives.

Please explain what is the C10K problem.

The C10K problem is a network socket that cannot handle a large number of clients (10,000) simultaneously.

Please state what the stub_status and sub_filter instructions do.

Stub_status command: This command is used to understand the current state of Nginx, such as the current active connections, the total number of read/write/wait connections accepted and processed

Sub_filter directive: This is used to search and replace the contents of the response and quickly repair stale data

15. Explain whether Nginx supports compressing requests upstream?

You can compress requests upstream using the Nginx module gunzip. The gunzip module is a filter that decompresses responses using "content encoding:gzip" for clients or servers that do not support the "gzip" encoding method.

Explain how to get the current time in Nginx?

To get the current time of Nginx, you must use the SSI module, the variables $date_gmt and $date_local.

Proxy_set_header THE-TIME $date_gmt;

17, What is the purpose of explaining-s with Nginx server?

Executable file used to run Nginx -s parameter.

Explain how to add modules to an Nginx server?

Nginx modules must be selected during compilation because Nginx does not support runtime selection of modules.

Thank you for reading, the above is the content of "what are the common topics in the Nginx interview", after learning this article, I believe that everyone has a deeper understanding of what are the common topics in the Nginx interview, and the specific use needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report