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

  • How to configure nginx static resource server
    How to configure nginx static resource server
    Enter the conf directory of the nginx installation directory, modify the nginx.conf file, and add a location part of the configuration code in a server{} as follows: root@ubuntu:/usr/local/nginx/conf#vinginx.confserver{listen80;server_namelocalhost;location /{roothtml;indexindex.htmlindex.htm;}location/image/{root/usr/local/myimage/;autoindexon;}} from
    Nginx 2200 2023-05-19 10:13:05
  • How to use Keepalived+Nginx+Tomcat to implement high-availability web cluster
    How to use Keepalived+Nginx+Tomcat to implement high-availability web cluster
    keepalived+nginx+tomcat implements high-availability web cluster 1. nginx installation process 1. Download the nginx installation package and install the dependent environment package (1) Install the c++ compilation environment yum-yinstallgcc#c++ (2) Install pcreyum-yinstallpcre-devel (3 )Install zlibyum-yinstallzlib-devel(4) Install nginx, locate the nginx decompression file location, and execute the compile and installation command [root@localhostnginx-1.12.2]#pwd/usr/local/nginx/nginx-1.12
    Nginx 1260 2023-05-19 10:01:05
  • How to configure nginx load balancing
    How to configure nginx load balancing
    Polling nginx distributes all requests evenly to each server in the cluster. upstreamtest{server127.0.0.1:7001;#Equivalent to server127.0.0.1:7001weight=1;server150.109.118.85:7001;#Equivalent to server150.109.118.85:7001weight=1;}server{listen8081;server_namelocalhost ;location/{proxy_passhttp://test/;}}upstream: Define a service cluster
    Nginx 4402 2023-05-19 09:59:21
  • What is the method to start and stop nginx in Linux system
    What is the method to start and stop nginx in Linux system
    Startup code format: nginx installation directory address-cnginx configuration file address For example: [root@LinuxServersbin]#/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf Stop nginx There are three ways: stop calmly 1. Check the process number [root@LinuxServer~]#ps-ef|grepnginx 2. Kill the process [root@LinuxServer~]#kill-QUIT2072 Stop quickly 1. Check the process number [root@LinuxSer
    Nginx 5501 2023-05-19 09:34:05
  • How does NGINX count the PV, UV, and independent IP of the website?
    How does NGINX count the PV, UV, and independent IP of the website?
    Concept: uv (uniquevisitor): unique visitor, each independent Internet computer (based on cookies) is regarded as a visitor, and the number of visitors who visit your website within a day (00:00-24:00). Visits to the same cookie within a day are only counted once PV (pageview): visits, that is, page views or clicks, each visit to the website by the user is recorded once. When a user visits the same page multiple times, the total number of visits is counted. Independent IP: The same IP address is only counted once within 00:00-24:00. Friends who do website optimization are most concerned about this. Let me first state the environment. This run nginx version 1.7, the backend tomcat runs dynamic
    Nginx 2649 2023-05-19 09:13:14
  • How to set nginx upload directory without execution permission
    How to set nginx upload directory without execution permission
    Copy the code as follows: orderallow, denydenyfromall and the one on the Internet that does not have execution permissions for the nginx upload directory. Copy the code as follows: location~^/upload/.*\.(php|php5)${denyall;} These configurations look like There is no problem, indeed it can be said under Windows. But *nux is different. Everyone knows that the *nux operating system is case-sensitive. If you change it to an uppercase suffix such as *.php, it will be bypassed. Here I will tell you my personal solution: copy the code. The following://? is a string that matches as many .php as possible, i is not
    Nginx 1202 2023-05-19 08:55:05
  • How to configure and use the index directory under Nginx server
    How to configure and use the index directory under Nginx server
    nginx configuration location~^/2589(/.*){autoindexon;//Turn on autoindex_localtimeon;//Turn on the display function}auto_index command syntax: autoindexon|off; Configuration section: autoindexoff; Configuration section: http, server, location enabled/only Use nginx directory indexing function. Syntax: autoindex_exact_sizeon|off; configuration section: autoindex_exact_sizeon; configuration section: http, server, location to determine whether
    Nginx 2042 2023-05-19 08:43:05
  • How to configure TCP load balancing in Nginx
    How to configure TCP load balancing in Nginx
    Assuming that the Kubernetes cluster has been configured, we will create a virtual machine for Nginx based on CentOS. The following are the details of the settings in the experiment: Nginx (CenOS8Minimal)–192.168.1.50KubeMaster–192.168.1.40KubeWorker1–192.168.1.41KubeWorker2–192.168.1.42 Step 1) Install the epel repository because the nginx software package is not in the CentOS system default repository. So you need to install e
    Nginx 1390 2023-05-19 08:29:28
  • How nginx uses the nginx-rtmp-module module to implement the live broadcast room function
    How nginx uses the nginx-rtmp-module module to implement the live broadcast room function
    System environment wujianjun@wujianjun-work~$uname-alinuxwujianjun-work4.10.0-37-generic#41~16.04.1-ubuntusmpfrioct622:42:59utc2017x86_64x86_64x86_64gnu/linux software environment obs(openbroadcastersoftware)v20.0.1(linux)nginx version:nginx/ 1.13.6builtbygcc5.4.020160609(ubuntu5.4.0-
    Nginx 1557 2023-05-19 08:13:05
  • What is the deployment method of Nginx and PHP
    What is the deployment method of Nginx and PHP
    Introduction to the 2 deployment methods. The first one uses an nginx server in front to do http reverse proxy and load balancing, and nginx on the back n server to do web services, and calls the fastcgi service provided by php-fpm. This deployment method is the most common, web service Both the php service and the php service are deployed on the same server. The second one is an nginx server in the front for web services. The back server only deploys the php-fpm service, which is used by the nginx server to call the front nginx server. After calling multiple php- When fpm serves, load balancing can also be achieved as shown below: Comparatively, from the perspective of system design, the first deployment is the conventional deployment method, which is applicable to large, medium and small-scale websites. The second type, different service departments
    Nginx 1252 2023-05-18 23:43:23
  • How to use nginx as a load balancer for mysql
    How to use nginx as a load balancer for mysql
    Note: The nginx version requirement is 1.9 or above. When compiling nginx, you need to add --with-stream, such as: ./configure--prefix=/data/apps/nginx--with-http_stub_status_module--with-http_ssl_module--with- http_realip_module--with-http_image_filter_module--with-stream Note 1. Because mysql uses port 3306 by default, when configuring nginxtcp reverse proxy mysql
    Nginx 1257 2023-05-18 22:37:10
  • 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 1137 2023-05-18 22:37:04
  • What are the common functions of Nginx?
    What are the common functions of Nginx?
    Commonly used functions of nginx 1. http proxy, reverse proxy: As one of the most commonly used functions of web servers, especially reverse proxy. Here I will give you two pictures to explain the positive agent and the reactive agent. You can read the information for the specific details. When nginx is used as a reverse proxy, it provides stable performance and can provide forwarding functions with flexible configuration. nginx can adopt different forwarding strategies based on different regular matching, such as going to the file server at the end of the image file, and going to the web server for dynamic pages. As long as you have no problem writing regular rules and have corresponding server solutions, you can do whatever you want. of play. And nginx performs error page jump, exception judgment, etc. on the returned results. If the distributed server stores
    Nginx 3481 2023-05-18 22:31:17
  • How to troubleshoot the problem of global reverse proxy already existing in Nginx file
    How to troubleshoot the problem of global reverse proxy already existing in Nginx file
    Project scenario: The Pagoda Linux panel built by Alibaba Cloud has already been built on other websites. I now add a reverse proxy port to a new website. However, when adding the reverse proxy through the Pagoda panel, the following pseudo-image appears. Static error. Problem Description Pseudo-static/nxinx main configuration/vhost/ file already exists a global reverse proxy. This problem actually tells us that a website in the nginx configuration file can only contain one location/, otherwise an error will be reported. Cause analysis: The problem is very clear, that is, there is a problem with the relevant configuration of nginx.conf. The first step is to check the relevant configuration files of the website. Click the website directly to enter the details to view the configuration files. se
    Nginx 4740 2023-05-18 21:13:19
  • What is the method to compile and install Nginx from source code?
    What is the method to compile and install Nginx from source code?
    Nginx is a lightweight web server/reverse proxy server and email proxy server released under a BSD-like license. Developed by Russian programmer lgorSysoev, it is used by Rambler, a large Russian portal and search engine. Its characteristics are that it occupies less memory and has strong concurrency capabilities. In fact, nginx's concurrency capabilities do perform better among web servers of the same type. Detailed description of nginx source code compilation parameters--prefix=points to the installation directory--sbin-path points to (execution) program file (nginx)--conf-path=points to the configuration file (nginx.conf)--error-log-
    Nginx 1028 2023-05-18 19:58:29

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!