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

  • How to configure multiple front-end projects in nginx
    How to configure multiple front-end projects in nginx
    Recently, a server needs to be configured with multiple front-end projects. Of course, nginx is required to separate the front-end and back-end projects. A single project is okay, modify the nginx.conf configuration file of nginx as follows #usernobody;worker_processes1;#error_loglogs/error.log;#error_loglogs/error.lognotice;#error_loglogs/error.loginfo;pid/usr/local/nginx/logs/ nginx.pid;events{worker_connections1024;}
    Nginx 2691 2023-05-21 10:34:20
  • How to configure Nginx anti-leeching
    How to configure Nginx anti-leeching
    For service performance considerations, we usually store HTML static resources on multiple services according to different types. If the topology diagram: the referer function in the hypertext transfer protocol referer: null means that the requester directly accesses referer: blocked, usually the referer added by the firewall device: url means that the host in the url tells the requester about the indirect access to jpg.good.com in the diagram It is obviously a server dedicated to users to store pictures, and www.good.com is a web server. It can be seen from the domain name that it must be a company. Conditions: 1. Only users who visit www.good.com are allowed to link to Identity access jpg.go
    Nginx 993 2023-05-21 10:04:11
  • How to implement nginx authentication
    How to implement nginx authentication
    Install httpdyuminstall and use htpasswd to produce the password file htpasswd-c/usr/local/nginx/conf/htpasswdaming#-c means creating the file, aming is the user name#When adding a user, you need to remove the -c parameter#How to modify the password and add users Configure nginx user authentication in the same way location/admin/{auth_basic"Auth";auth_basic_user_file/usr/local/nginx/conf/htpasswd;}
    Nginx 1442 2023-05-21 10:04:05
  • What is the process of Nginx dynamic domain name resolution?
    What is the process of Nginx dynamic domain name resolution?
    Summary When Nginx performs reverse proxy, it will perform domain name resolution, resolve the domain name to a specific IP and cache it locally. If the IP corresponding to the domain name changes, it will cause the Nginx proxy to fail. The Nginx resolver directive is used below to implement domain name dynamics. parse. Dynamically resolve the intranet DNS server based on a custom DNS server. I use dnsmasqdefault.conf to configure server{listen80;root/usr/share/nginx/html/;resolver192.168.137.110valid=5s;set$proxy_urlhuzhihui.loca
    Nginx 1968 2023-05-21 09:34:05
  • How to use Docker to build an Nginx+PHP+MySQL environment and deploy WordPress
    How to use Docker to build an Nginx+PHP+MySQL environment and deploy WordPress
    Preparation: Use Alibaba Cloud kelude to create a project, such as a dockerfile. After that, we place all related dockerfile and configuration files of the wordpress environment into the centosbz directory. Use Alibaba Cloud Image Warehouse Alibaba Cloud Docker Image Warehouse address is, which is used to store docker images. You can push the image locally, or you can pull the dockerfile from kelude to automatically build the image. We log in first, and then create a new namespace, such as centos-bz. After that, all nginx, php, and mysql images will be stored in this namespace. Install docker-co
    Nginx 1783 2023-05-21 09:19:11
  • How to solve the problem of nginx hidden version number and WEB server information
    How to solve the problem of nginx hidden version number and WEB server information
    nginx can not only hide version information, but also supports custom web server information. Let’s take a look at the final hidden result. How to achieve it? It’s actually very simple. Please look down 1. Official website to download the latest stable version wgethttp://nginx.org/ download/nginx-1.14.1.tar.gz2 Unzip tar-xfnginx-1.14.1.tar.gzcdnginx-1.14.13 Modify the c file (1) vimsrc/http/ngx_http_header_filter_module.c       #Modify line 49 staticu_charngx_http_
    Nginx 1579 2023-05-21 09:13:05
  • How to install Nginx using YUM under CentOS7 system
    How to install Nginx using YUM under CentOS7 system
    Introduction nginx was developed by igorsysoev for Russia's second most visited rambler.ru site. The first public version 0.1.0 was released on October 4, 2004. It releases its source code under a BSD-like license and is known for its stability, rich feature set, sample configuration files, and low system resource consumption. The steps in the centos7 conditional tutorial require root user privileges. 1. Add nginx to the yum source. Add the centos7nginxyum resource library, open the terminal, and use the following command: sudorpm-uvhhttp://nginx.org/packages/centos/7/noarch/r
    Nginx 1397 2023-05-21 08:40:06
  • How to configure and optimize FastCGI in Nginx
    How to configure and optimize FastCGI in Nginx
    fastcgi: fastcgi is developed and improved from cgi. The main disadvantage of the traditional cgi interface method is poor performance, because every time the http server encounters a dynamic program, the script parser needs to be restarted to perform parsing, and then the results are returned to the http server. This is almost unavailable when dealing with high concurrent access. In addition, the traditional cgi interface method has poor security and is rarely used now. The fastcgi interface mode adopts the c/s structure, which can separate the http server and the script parsing server, and start one or more script parsing daemons on the script parsing server. Every time the http server encounters a dynamic program, it can be delivered directly to fastcg
    Nginx 2654 2023-05-21 08:16:27
  • How to solve nginx+php-fpm service HTTP status code 502
    How to solve nginx+php-fpm service HTTP status code 502
    For one of our web projects, due to the increase in new cities, the number of visits has increased and the pressure on the db has increased. As a business party that provides interfaces, a large number of "502" requests have been reported recently by downstream feedback. 502, badgateway, is usually an error in upstream (here is PHP). For PHP, the common cause of 502 is that the script execution exceeds the timeout setting time, or the timeout setting is too large, resulting in the PHP process not being released for a long time, and there are no idle workers. process to pick up guests. Our project is caused by the PHP execution time setting being too short. In this case, you can first increase the PHP execution time appropriately and ensure that 502 is cleared first. Optimization will cost more after all.
    Nginx 1130 2023-05-21 08:07:05
  • nginx load balancing instance analysis
    nginx load balancing instance analysis
    Note on load balancing of nginx. As you can see, since our website is in the early stages of development, nginx only acts as an agent for one back-end server. However, as our website’s reputation has grown and more and more people are visiting, one server cannot handle it. , so we added multiple servers. How do we configure proxies for so many servers? Here we take two servers as an example to demonstrate for everyone. 1. Upstream load balancing module description case: The following sets the load balancing server list. upstreamtest.net{ip_hash;server192.168.10.13:80;server192.168.10.14:80down;server192.1
    Nginx 1050 2023-05-21 08:01:32
  • How to customize PHP's $_SERVER variable in nginx
    How to customize PHP's $_SERVER variable in nginx
    1. First, add the variable values ​​you want to add in the nginx configuration. The file content is as follows: location~\.php${try_files$uri=404;root/data/www.shuchengxian.com/;fastcgi_pass127.0.0.1 :9000;fastcgi_indexindex.php;fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;fastcgi_paramENVIRONMENT'DEV&a
    Nginx 1349 2023-05-20 23:52:04
  • How to set up a high-performance WEB server with Linux+Nginx+Php
    How to set up a high-performance WEB server with Linux+Nginx+Php
    nginx ("enginex") is a high-performance http and reverse proxy server, as well as an imap/pop3/smtp proxy server. nginx was developed by igorsysoev for Russia's second most visited rambler.ru site, where it has been running for more than two and a half years. igor releases the source code under a BSD-like license. Although still in beta, nginx is already known for its stability, rich feature set, sample configuration files, and low system resource consumption. Installation step 1. Compile and install the support library tarzxvflibiconv-1.13.t required for php5.2.9
    Nginx 1144 2023-05-20 23:19:55
  • How to use nginx and docker to implement a simple load balancing
    How to use nginx and docker to implement a simple load balancing
    Test steps: 1. Build an nginx server in the server and start it. 2. Pull the official image of nginx from the source in docker, dockerpullnginx, and keep it for later use. 3. Create two new folders in the local directory. I created them here. /mydata/test1, /mydata/test2/4. Create new index.html in the two test folders to mark them. Output thisisnginx1 in the first html, and output thisisnginx2 in the second html. 5. Run through docker Containers of two nginx servers and map the static directories to the directories we just created
    Nginx 830 2023-05-20 22:01:04
  • How to set up nginx+php server application under Linux system
    How to set up nginx+php server application under Linux system
    It is similar to installing other software. The installation process is basically a fool-proof installation of nginx. Execute the following command and it will be completed quickly sudoapt-getinstallnginx. The default installation location of the configuration file: conf:/etc/nginx/nginx.confbin:/usr/sbin/ nginxvhost:/etc/nginx/sites-enable/defaultcgi-params:/etc/nginx/fastcgi-params Install the php-cgi module sudoapt-getinstallphp5-cgi The default installation location of the configuration file
    Nginx 1119 2023-05-20 19:55:04
  • How Nginx reverse proxy implements session persistence
    How Nginx reverse proxy implements session persistence
    1. ip_hash: ip_hash uses the source address hash algorithm to always send requests from the same client to the same back-end server unless the server is unavailable. ip_hash syntax: upstreambackend{ip_hash;serverbackend1.example.com;serverbackend2.example.com;serverbackend3.example.comdown;serverbackend4.example.com;}ip_hash is simple and easy to use, but has the following problems: when the backend server goes down, session will be lost; from the same
    Nginx 1510 2023-05-20 19:25:20

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!