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

  • How to solve the problem when docker fails to run nginx binding configuration file
    How to solve the problem when docker fails to run nginx binding configuration file
    Executing the startup command directly will fail to pull the image: dockerpullnginx and then execute the startup command: dockerrun-d-p80:80-p443:443--namenginx\-v/mydata/nginx/html:/usr/share/nginx/html\-v /mydata/nginx/conf/nginx.conf:/etc/nginx/nginx.conf\-v/mydata/nginx/conf/conf.d:/etc/nginx/conf.d\-v/mydata/nginx/logs :/var/
    Nginx 948 2023-05-17 09:34:05
  • How to set up nginx reverse proxy ftp server
    How to set up nginx reverse proxy ftp server
    1. Install nginx 2. Install vsftpd 3. Modify the nginx configuration file nginx.conf 3.1 Add the ftp user userftpuser in the first line; 3.2 Configure the relevant path server{ listen80; #nginx proxy port server_namelocalhost; #ftp server address location/images{root /home/ftpuser; #The absolute path of the folder of the proxy ftp server indexftpuser; #Set the welcome page
    Nginx 4907 2023-05-17 09:31:18
  • How to install nodejs under ubuntu and implement Nginx reverse proxy server
    How to install nodejs under ubuntu and implement Nginx reverse proxy server
    1. It is strongly recommended to use nvm (node ​​version manager) to install the new version of nodejs. There are more or less problems with other installation methods. The specific steps are as follows: 1. Download nvm through the git command. The execution command is as follows. We download nvm to /root/git/ (remember to install git first): [root@vm-22-180-ubuntu~]#pwd/ root[root@vm-22-180-ubuntu~]#mkdirgit[root@vm-22-180-ubuntu~]#cdgit[root@vm-22-180-ubuntu~]#gitclonehttps://
    Nginx 1562 2023-05-17 09:13:05
  • How nginx implements load balancing and multi-site sharing session
    How nginx implements load balancing and multi-site sharing session
    Common methods for multi-site sharing sessions include: • Using .net automatic state service (asp.netstateservice); • Using .net session database; • Using memcached. •Use cookies to achieve sharing between multiple sites (this method is limited to when several sites are in the same domain name); here we will practice storing sessions in the form of a database to achieve multi-site sharing sessions. First, we build the site, as shown below: default.aspx has two buttons. Setsession is mainly used to assign values ​​to a session (such as: session
    Nginx 1248 2023-05-17 08:31:13
  • How to use Nginx as a Perl program server and its Perl module under Linux
    How to use Nginx as a Perl program server and its Perl module under Linux
    Building perl+fastcgi+nginx nginx+fastcgi is the most popular environment under PHP. Will perl also have fastcgi? Of course it does. Today, let’s build perl’s fastcgi under nginx. The performance is no less than that of PHP. But now the popularity of the web program PHP is unmatched by perl. No matter how good the performance is, it is in vain. However, some small functions can be solved by using perl's fastcgi. Let's get to the point. 1. Prepare the software environment: nginxperl: The system comes with fastcgi1.2perl installation Generally, Linux comes with perl, so you don’t need to install it. If it doesn’t, please execute:
    Nginx 1035 2023-05-16 23:25:51
  • How to solve nginx server configuration CPU error
    How to solve nginx server configuration CPU error
    First, check the possibility of customer problems: Due to excessive traffic on the website, the number of IP addresses exceeds one million per day, which causes the CPU to increase crazily and directly to 100% operating rate, causing the server to crash and freeze. After several days of research, we came to a result: That is, the connection is blocked, causing an endless loop of crashes. After each crash, as long as it is restarted, it will be blocked and crashed again about 2-3 hours later. After the programmer's analysis, it may be that the traffic exceeds the delay and causes the crash. So what is the solution to frequent CPU alarms when encountering nginx server configuration: First, you need to determine whether the server configuration is sufficient, and this user is using a BGP server, the bandwidth and configuration are sufficient E5-2650V4*232G Memory 250G Samsung SSD, so
    Nginx 1735 2023-05-16 23:01:04
  • How to integrate nginx with lua to operate mysql
    How to integrate nginx with lua to operate mysql
    The implementation idea is to directly configure the blacklist in nginx and implement it by writing logical blocks; write the filter in the server (Java) and unify the interceptors in the filter; write the interceptor in the server (Java) and unify the interceptors Interception; here are 3 implementation ideas. As for implementation solutions, there may be more, but if we think about it, writing logical blocks in nginx does not seem to be what many people are good at; it is not impossible to do it at the code level, but this is First, during peak business periods involving high concurrency, this will inevitably put greater pressure on back-end services. So are there any other better ways to deal with it? This is what lua is about, that is, nginx acts as a gateway and still acts as a proxy server, because nginx can integrate lua
    Nginx 1270 2023-05-16 22:43:11
  • Analysis of example code for installing nginx under linux
    Analysis of example code for installing nginx under linux
    Linux system is centos 64-bit introduction 1. Common methods for Linux installation software 1. rpm (or pkg) installation, similar to the windows installation program, is a precompiled program. General parameter compilation is used, and the configuration parameters are not optimal and controllable. For example, customized installation of specific components of the program usually has complex dependencies between installation packages, making the operation complex and easy to install, with a low error rate. 2. yum (or apt -get) installation, an improved version of rpm, automatically downloads installation packages online, and automatically manages dependencies 3. Compilation and installation (the method is not very different among various Linux distributions) is highly controllable, and can be optimized according to the current system environment during config Parameters, customizable components and easy installation parameters
    Nginx 644 2023-05-16 22:13:04
  • How to replace nginx with openresty
    How to replace nginx with openresty
    OpenResty, also known as ngx_openresty, is a core web application server based on Nginx. OpenResty is a high-performance web platform based on Nginx and Lua. OpenResty effectively turns Nginx into a powerful one by bringing together various well-designed Nginx modules. Universal web application platform. Download openrestywgethttps://openresty.org/download/openresty-1.15.8.1.tar.gztarzxvfopenresty-1.15.8.1.tar.gzcdopenresty
    Nginx 1232 2023-05-16 22:10:05
  • How to solve the problem that nginx cannot start because port 80 is occupied under windows
    How to solve the problem that nginx cannot start because port 80 is occupied under windows
    1. Install and download the latest version used under Windows, which is currently 1.11.10, as shown in the figure: Just download and unzip it. 2. Run nginx, error: [emerg]10348#10940:bind()to0.0.0.0:80failed(10013:anaattemptwasmadetoaccessasocketinawayforbiddenbyitsaccesspermissions) as shown in the figure: It can also be seen in the log, open: nginx-1.11.10\ logs\error.log is shown in the figure: nginx uses port 80 by default, but w
    Nginx 2503 2023-05-16 21:56:36
  • How to optimize Nginx configuration and kernel
    How to optimize Nginx configuration and kernel
    The optimization (configuration file) copy code in the nginx instruction is as follows: worker_processes8; The number of nginx processes is recommended to be specified according to the number of cpu, usually a multiple of it. Copy the code as follows: worker_cpu_affinity0000000100000010000001000000100000010000001000000100000010000000; Assign a CPU to each process. In the above example, 8 processes are assigned to 8 CPUs. Of course, you can write multiple, or assign one process to multiple CPUs. Copy the code code as follows: worker_rlimit_nofi
    Nginx 1391 2023-05-16 21:43:27
  • How to access multiple projects with one domain name in Nginx
    How to access multiple projects with one domain name in Nginx
    Introduction to matching of location module 1. "=" prefix directive matching, if the matching is successful, other matching will be stopped. 2. Ordinary string instructions are matched in order from longest to shortest. If the successfully matched location uses ^~, other matching will be stopped (regular matching). 3. Regular expression instructions are matched according to the order in the configuration file. If successful, other matching will be stopped. 4. If there is a successful match in the third step, use the result, otherwise use the second step result. Note 1. The matching order is to match ordinary strings first, and then match regular expressions. In addition, the matching order of ordinary strings is based on the character length in the configuration from long to short, which means that the order of locations configured using ordinary strings is irrelevant, anyway.
    Nginx 2114 2023-05-16 21:37:20
  • How to use nginx to deploy vue2 project under Windows system
    How to use nginx to deploy vue2 project under Windows system
    Step 1: Download and install nginx1. First, we need to go to the official website of nginx to download the windows version of nginx2. After clicking the download link, you will download the following nginx compressed package: 3. Unzip the nginx compressed package. You need to pay attention here, nginx The decompression path cannot contain Chinese characters, otherwise the nginx service will not start normally. If you don’t believe me, try 4. We double-click the nginx.exe file to start the service. Friends who observe carefully will find that there is a black pop-up window that disappears in a flash. , then the startup is complete. 5. Then we open the browser and access: http://localhost. If the following interface appears, it means that the nginx service has started successfully!
    Nginx 2576 2023-05-16 21:37:11
  • How to use proxy_pass in Nginx
    How to use proxy_pass in Nginx
    1. nginx official guide for proxy_pass. There are two modules in nginx that have proxy_pass instructions. Proxy_pass of ngx_http_proxy_module: Syntax: proxy_passURL; Scenario: location, ifinlocation, limit_except Description: Set the protocol and address of the back-end proxy server, and an optional URI that can be matched in location. The protocol can be "http" or "https". address
    Nginx 1691 2023-05-16 20:38:15
  • How to solve the problem that the page does not refresh due to nginx configuration in Linux environment
    How to solve the problem that the page does not refresh due to nginx configuration in Linux environment
    In a Linux environment, nginx load balancing is configured, but the cache mechanism may not be successfully configured in the virtual host's configuration file nginx.conf, causing the page not to refresh and still display the contents of the cache. Finally, comment on the relevant cache configuration in the nginx.conf file, and then go to the tmp directory to view the generated cache file, as shown in the figure: Here we need to delete the proxy_cache and proxy_temp files: restart the nginx service: sercivenginxrestart
    Nginx 1631 2023-05-16 20:26:12

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