current location:Home > Technical Articles > Operation and Maintenance > Nginx

  • How to build and configure nginx server
    How to build and configure nginx server
    1. Installation of compilation tools and library files depends on library installation, and must be installed in order: (1) If the c++ compilation environment is not installed, yuminstallgcc-c++ (2) The ssl function requires the openssl library wgethttps://www.openssl.org/source/ openssl-1.1.0f.tar.gztar-zxvfopenssl-1.1.0f.tar.gzcdopenssl-1.1.0f./configmake&&makeinstall(3) The rewrite module requires the pcre library wgethttps://ftp.pc
    Nginx 1982 2023-05-26 16:13:06
  • How to set whitelist in Nginx through geo module
    How to set whitelist in Nginx through geo module
    Original configuration: http{......limit_conn_zone$binary_remote_addrzone=one:10m;limit_req_zone$binary_remote_addrzone=fifa:10mrate=5r/s;......server{......limit_connone5;limit_reqzone=fifaburst =100;......}}White name placement: http{......geo$whiteiplist{default1;127.0.0.10;10.10.0.0
    Nginx 1220 2023-05-26 13:10:51
  • How to solve nginx not prompting php error
    How to solve nginx not prompting php error
    1. Understand error reporting and collection methods. During the process of deploying the server, we habitually turn off the error output of PHP. This is because PHP error messages may expose security risks or lead to information leakage. But during the development process, we need these error messages to locate problems and debug the program. One way to solve this problem is to turn on PHP's error output. In PHP we can set the error log level or report errors immediately. At the same time, we can also add some options to the Nginx configuration file to display PHP error messages. 2. PHP error settings in the Nginx configuration file. Open the Nginx server configuration file, usually /etc/nginx/nginx.conf
    Nginx 1846 2023-05-26 13:03:46
  • How to configure the nginx-http-footer-filter module of Nginx server
    How to configure the nginx-http-footer-filter module of Nginx server
    1.What exactly does nginx-http-footer-filter do? To put it bluntly, it means inserting the code you want to insert at the bottom of the requested page. 2. What can we use nginx-http-footer-filter for? 1. Add js code uniformly for statistics (this is what I think) 2. Add the realsver (backend real server) information that responds to this request at the bottom to facilitate system administrators to troubleshoot. 3. You manage a large number of virtual hosts , append your advertising code, black link, etc. (very shameless) behind all web pages. 4. Draw inferences from one example and think about what you can use it for. What does Taobao use it for? Open the Taobao homepage, view its source code, drag it to the bottom
    Nginx 1257 2023-05-26 12:31:46
  • How to use nginx proxy to access static resources
    How to use nginx proxy to access static resources
    1. Goal: In order to request static resources (css, pictures, etc.) through nginx, page preview is performed through the nginx proxy. 2. Implementation effect: Enter the nginx proxy address through the browser to open the page to access the local html file, or you can access the proxy routing access interface to achieve the page preview function. Note: What I demonstrate is configuration three in the local windows development environment. Specific configuration 1. nginx configures the local static project agent. Find the nginx configuration file nginx.conf and configure the nginx agent server{listen80;#Front-end portal project location/{aliasD:/workspace/sc-multip
    Nginx 9360 2023-05-26 12:25:20
  • How to build a load balancing server based on Centos7+Nginx+Tomcat8
    How to build a load balancing server based on Centos7+Nginx+Tomcat8
    After manually installing nginx, everything is normal, and there are no problems with the configuration of the virtual host and load balancing. It was successfully enabled. The specific configuration file is as follows: Added: includevhost/*.conf; to the nginx.conf file of conf to introduce all the .conf files in the vhost directory. In order to make it easy to configure in the future, of course, if necessary, You can also add them one by one. Because the load service is an api service, the name of the conf file here is called api.xxx.com.conf. The configuration of opening the file is as follows: The ip polling method is not used here, but the usstream method is used. Specifically What is the difference between these methods?
    Nginx 1662 2023-05-26 11:43:13
  • Example analysis of nginx opening directory listing
    Example analysis of nginx opening directory listing
    nginx enables column directory When you want nginx to exist as a file download server, you need to enable nginx column directory server{locationdownload{autoindexon;autoindex_exact_sizeoff;autoindex_localtimeon;}}autoindex_exact_size: When it is on (default), the exact size of the file is displayed, in byte ;Change to off to display the approximate size of the file, in KB or MB or GBautoindex_localtime: When it is off (default), the file time displayed is GMT time; after changing to on, it is displayed
    Nginx 1563 2023-05-26 11:36:40
  • How to enable pathinfo in nginx
    How to enable pathinfo in nginx
    To transfer apache to nginx, $_server['path_info'] is used on the code side. Pathinfo is not enabled by default for nginx. So we have to manually enable 1, url rewrite location/{//Method 1if(!-e$request_filename){rewrite^/(.*)$/index.php/$1last;break;}}location/{/ /Method 2try_files$uri$uri//index.php$uri;}2, pathinfo sets location~.
    Nginx 1239 2023-05-26 10:43:13
  • How to set nginx current limit
    How to set nginx current limit
    1. Current limiting nginx Set up nginx current limiting using the module upstream and place it in the http module #current limit concurrency upstreamnode{server127.0.0.1:8080max_conns=1;}#Exceeding requests will return a 502 status code and place it in the server module #Test address, Accessing the server py path will be forwarded to the local machine's 8080 port location/py{proxy_passhttp://node/;}#Error redirected to the downgrade interface error_page502503https://fund/b.html; Note: If one / is missing, it will Forward the request to 8080/
    Nginx 2358 2023-05-26 10:07:26
  • How to achieve Nginx high availability
    How to achieve Nginx high availability
    Preparation work: 192.168.16.128192.168.16.129 two virtual machines. Install Nginx. Install Nginx and update the yum source file: rpm-ivhhttp://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpmwget-O/ etc/yum.repos.d/CentOS-Base.repohttp://mirrors.aliyun.com/repo/Centos-7.repoInstall Nginx
    Nginx 1229 2023-05-25 23:31:04
  • How to realize the coexistence of Nginx and Apache under Linux server
    How to realize the coexistence of Nginx and Apache under Linux server
    Two programs cannot listen on the same port at the same time. So another way of thinking is to solve the problem of coexistence of some websites running under nginx and some websites running under apache on the same server. Solution: Use nginx as a proxy server and web server. nginx listens to port 80, and apache listens to ports other than 80. I am temporarily using port 8080. Solution: Once the Linux environment is set up, nginx and apache are installed successively. Since the default ports are: 80, the server port requested by general customers defaults to 80, so nginx is set as a static page port: 80; apache sets the port to: 8080 (in httpd Repair in .conf file
    Nginx 1937 2023-05-25 23:28:13
  • How to configure Nginx for NodeJS application load balancing
    How to configure Nginx for NodeJS application load balancing
    Load balancing can allocate user requests to multiple servers for processing, thereby achieving access support for a large number of users. The load balancing architecture is shown in the figure: For complex web applications, using nginx for front-end load balancing is a matter of course. Next, we use nginx for load balancing of nodejs applications. 1. Configure nginx and modify nginx.conf: upstreamsample{server127.0.0.1:3000;server127.0.0.1:3001;keepalive64;}server{listen80;....server_name127.0.0.1;...
    Nginx 1537 2023-05-25 23:19:04
  • How to configure GZip compression when a Node.js site uses Nginx as a reverse proxy
    How to configure GZip compression when a Node.js site uses Nginx as a reverse proxy
    For a site developed with node.js, if you also use nginx to implement reverse proxy, you can easily implement gzip compression on the server side to make site browsing smoother. Prerequisite: node.js+nginx reverse proxy. node.js required Work done: versions below express4.0: app.use(express.compress()); // Mainly this sentence app.use(express.json()); app.use(express.urlencoded()); app .use(express.bodyparser());app.use(express.met
    Nginx 1328 2023-05-25 19:13:04
  • How nginx automatically generates configuration files in docker containers
    How nginx automatically generates configuration files in docker containers
    The final command to implement the idea is probably like this: dockerrun-d-p80:80-exxx=xx Image name Script path in the image The script here will replace the cmd command in the dockerfile, so we need to build a shell that automatically generates and starts nginx script. #!/bin/bash#Get the beginning of lt from the environment variable, in order to distinguish it from other environment variables, for example, lt_analysis=172.17.0.1:8083result=""forain$(env|grep^lt)doold_ifs="$ifs"ifs =&qu
    Nginx 1105 2023-05-25 18:25:06
  • How to configure nginx on centos server
    How to configure nginx on centos server
    Download the secure terminal mobaxterm_personal. First, after downloading the secure terminal, connect to your own public network IP and the display will be as shown above after successful connection. Introduction to nginx nginx is a lightweight web server and reverse proxy server. Compared with apache and lighttpd, it has the advantages of less memory and high stability. Its most common use is to provide a reverse proxy service. After connecting to the server, the first step: install gccgcc-c++. The command is: yuminstall-ygccgcc-c++. The second step: install the pcre library $cd/usr/local/$wgethttp:// jaist.dl.sourceforge.net/p
    Nginx 2450 2023-05-25 15:58:06

Tool Recommendations

jQuery enterprise message form contact code

jQuery enterprise message form contact code is a simple and practical enterprise message form and contact us introduction page code.
form button
2024-02-29

HTML5 MP3 music box playback effects

HTML5 MP3 music box playback special effect is an mp3 music player based on HTML5 css3 to create cute music box emoticons and click the switch button.

HTML5 cool particle animation navigation menu special effects

HTML5 cool particle animation navigation menu special effect is a special effect that changes color when the navigation menu is hovered by the mouse.
Menu navigation
2024-02-29

jQuery visual form drag and drop editing code

jQuery visual form drag and drop editing code is a visual form based on jQuery and bootstrap framework.
form button
2024-02-29

Organic fruit and vegetable supplier web template Bootstrap5

An organic fruit and vegetable supplier web template-Bootstrap5
Bootstrap template
2023-02-03

Bootstrap3 multifunctional data information background management responsive web page template-Novus

Bootstrap3 multifunctional data information background management responsive web page template-Novus
backend template
2023-02-02

Real estate resource service platform web page template Bootstrap5

Real estate resource service platform web page template Bootstrap5
Bootstrap template
2023-02-02

Simple resume information web template Bootstrap4

Simple resume information web template Bootstrap4
Bootstrap template
2023-02-02

Cute summer elements vector material (EPS PNG)

This is a cute summer element vector material, including the sun, sun hat, coconut tree, bikini, airplane, watermelon, ice cream, ice cream, cold drink, swimming ring, flip-flops, pineapple, conch, shell, starfish, crab, Lemons, sunscreen, sunglasses, etc., the materials are provided in EPS and PNG formats, including JPG previews.
PNG material
2024-05-09

Four red 2023 graduation badges vector material (AI EPS PNG)

This is a red 2023 graduation badge vector material, four in total, available in AI, EPS and PNG formats, including JPG preview.
PNG material
2024-02-29

Singing bird and cart filled with flowers design spring banner vector material (AI EPS)

This is a spring banner vector material designed with singing birds and a cart full of flowers. It is available in AI and EPS formats, including JPG preview.
banner picture
2024-02-29

Golden graduation cap vector material (EPS PNG)

This is a golden graduation cap vector material, available in EPS and PNG formats, including JPG preview.
PNG material
2024-02-27

Home Decor Cleaning and Repair Service Company Website Template

Home Decoration Cleaning and Maintenance Service Company Website Template is a website template download suitable for promotional websites that provide home decoration, cleaning, maintenance and other service organizations. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-05-09

Fresh color personal resume guide page template

Fresh color matching personal job application resume guide page template is a personal job search resume work display guide page web template download suitable for fresh color matching style. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-29

Designer Creative Job Resume Web Template

Designer Creative Job Resume Web Template is a downloadable web template for personal job resume display suitable for various designer positions. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28

Modern engineering construction company website template

The modern engineering and construction company website template is a downloadable website template suitable for promotion of the engineering and construction service industry. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28