Article Tags
How to install and configure nginx under Centos7

How to install and configure nginx under Centos7

Note: The basic directory path for software installation: /usr/local, so when downloading the software, switch to this directory and download and unzip it directly 1. Install the gccgcc-c++ dependency package yuminstall-ygccgcc-c++ 2. Download, compile and install the pcre library Switch to the usr/local directory and execute the command to download the installation package wget decompress the installation package tar-zxvfpcre-8.36.tar.gz compile and install cdpcre-8.36./configuremake&&makeinstall3. Download compile and install the ssl library download the installation package wget decompress the compressed package tar-zxvfopenssl

Jun 03, 2023 pm 01:36 PM
nginx centos7
How to configure PATHINFO in Nginx to hide thinkphp index.php

How to configure PATHINFO in Nginx to hide thinkphp index.php

nginx configuration pathinfo hides index.php Put this code in the nginx configuration file server{listen80;default_typetext/plain;root/var/www/html;indexindex.phpindex.htmindex.html;#hide index.phplocation/{if(!- e$request_filename){#First-level directory#rewrite^/(.*)$/index.php/$1last;#Second-level directory rewrite^/myapp/(.*)$/myapp/

Jun 03, 2023 pm 01:18 PM
nginx pathinfo
How to configure Nginx host domain name

How to configure Nginx host domain name

1. Configure multiple ports to access different files with the same domain name, different ports, and different files #Two different folders, storing different files respectively [root@nginx~]#mkdir/www/work_01-p[root@nginx~]#mkdir /www/work_02[root@nginx~]#vim/www/work_01/index.htmlthisiswork_01![root@nginx~]#vim/www/work_02/index.htmlthisiswork_02!#Edit the server module and point the port 80 site to a folder and copy it

Jun 03, 2023 pm 01:13 PM
nginx
How to optimize Nginx and Node.js

How to optimize Nginx and Node.js

If network optimization does not first understand the underlying transmission mechanisms of nginx and node.js and carry out targeted optimization, no matter how detailed the optimization of the two is, it may be in vain. Generally, nginx connects the client and upstream applications through tcpsocket. Our system has many thresholds and restrictions for tcp, which are set through kernel parameters. The default values ​​of these parameters are often set for general purposes and cannot meet the high traffic and short life requirements of web servers. Here are some parameters that are candidates for tuning tcp. To make them effective, you can place them in the /etc/sysctl.conf file, or put them in a new configuration file, such as /etc/sysctl.

Jun 03, 2023 pm 12:41 PM
Node.js nginx
How to configure caching of static files in nginx

How to configure caching of static files in nginx

1. Preparation matters I think you need a normal working nginx software: install nginx, php7 and mysql5.7 (lemp) on ubuntu16.04lts. 2 To configure nginx, you can refer to the expires command manual to set the http header expiration time. This mark can be placed in statement blocks such as http{}, server{}, location{}, or conditional statements in the location{} statement block. Generally, you will use the expires directive in the location statement block to control your static files, like the following: location~*\.(jpg|jpeg|png|gif|ico|css|js

Jun 03, 2023 pm 12:31 PM
nginx
How to use nginx simulation for blue-green deployment

How to use nginx simulation for blue-green deployment

Blue-green deployment The focus of blue-green deployment lies in the following characteristics: 1. The blue version and the green version exist at the same time. 2. The actual running environment is blue or green, and can only be one of them. Analysis of advantages and disadvantages through switch control: The advantages are: It's speed and rollback. And the shortcomings are also obvious. Quick rollback is possible because two sets of environments exist at the same time, so the complexity and required resources will increase because there are two sets of environments. In addition, although the speed has been improved, in the implementation process, the switch control, no matter how fast the switching speed, is still unable to achieve completely seamless switching without combining other technologies. Simulate blue-green deployment Next, we use nginx's upstream to simply simulate the blue-green deployment scenario. The specific scenarios are as follows, currently active

Jun 03, 2023 pm 12:31 PM
nginx
How nginx rewrite implements URL jump

How nginx rewrite implements URL jump

URL jump The URL jump mentioned here is to jump to another URL when the user accesses one URL. A common application scenario is to let multiple domain names jump to the same URL (for example, let the old domain name jump to a new domain name), jump static file requests to CDN, etc. Jump to different sites according to the user's device (PC version) , wap version), etc. URL jump can be achieved by setting the window.location on the page with js or by setting the header with php. Of course, it can also be implemented using the rewrite function of nginx. The nginxrewrite module rewrite is the static rewrite module of nginx. The basic usage is rewritepattenre.

Jun 03, 2023 am 11:55 AM
URL nginx rewrite
How to configure nginx log scheduled backup and deletion

How to configure nginx log scheduled backup and deletion

Once the nginx logging function is turned on, nginx will generate log files of a certain size every day. If the system runs stably and there are no problems, then the logs will basically not be viewed. However, if these logs are not cleared in time, they will accumulate day by day and occupy a terrible amount of disk space on the server. In order to solve this problem, use a shell script to regularly back up and delete nginx log files, and only keep them for a period of time. Figure 1: #!/bin/bash#auth:lzq#desc: Back up the current log by date and regenerate the next day’s log file #date:2016-09-18date=`date+%y%m%d`nginx_pid =`cat/var

Jun 03, 2023 am 10:59 AM
nginx
How does Nginx realize 404 automatically jump to the home page?

How does Nginx realize 404 automatically jump to the home page?

404 automatically jumps to the homepage server{location/{error_page404=@ops-coffee;}location@ops-coffee{rewrite.*/permanent;}}. The 404 page on the website is not particularly friendly. We can use the configuration above to prevent 404 from appearing. Then it will automatically jump to the home page.

Jun 03, 2023 am 10:16 AM
nginx
What should I do if nginx deploys vue and cannot find the js css file?

What should I do if nginx deploys vue and cannot find the js css file?

Many times after npmrunbuild, the relative directory of the js file and css file automatically inserted by webpack in the index.html file is always wrong. After publishing it to the server, nginx cannot find the file. vue-cli@3 In vue-cli@3 you need to add a baseurl for all files that your webpack inserts into index.html. You need to create a new vue.config.js in the root directory of the project and add the following content:. ..module.exports={baseurl:isprod?'/basexxx/':&#3

Jun 03, 2023 am 10:05 AM
CSS VUE nginx
Nginx basic introduction to gzip configuration method

Nginx basic introduction to gzip configuration method

Preface gzip (gnu-zip) is a compression technology. After gzip compression, the page size can be reduced to 30% or even smaller than the original size. In this way, users will browse the page much faster. The gzip compressed page needs to be supported by both the browser and the server. It is actually server-side compression. After being transmitted to the browser, the browser decompresses and parses it. We don’t need to worry about the browser, because most current browsers support parsing gzip pages. Whether it is front-end or back-end, nginx is often used when deploying projects, and small projects often use a reverse proxy or something. Today I will be simple and direct and talk about one of the points - gzip. If there are any errors, please correct me. Generally used on the server side is u

Jun 03, 2023 am 09:52 AM
nginx gzip
How to install and configure Nginx on Linux server

How to install and configure Nginx on Linux server

nginx installation 1. Install the compilation tools and library files yum-yinstallmakezlibzlib-develgcc-c++libtoolopensslopenssl-devel 2. First install pcrepcre to enable nginx to support the rewrite function. 1. Download the pcre installation package, download address: [root@bogonsrc]#wgethttp://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz2. Unzip the installation package: [root@bogonsrc

Jun 03, 2023 am 09:40 AM
Linux nginx
Example analysis of adding account and password verification to nginx

Example analysis of adding account and password verification to nginx

nginx adds account and password authentication server{location/{auth_basic"pleaseinputuser&passwd";auth_basic_user_filekey/auth.key;}}. There are many services accessed through nginx, but they do not provide account authentication functions. You can use the authbase account password authentication provided by nginx. To implement, you can use the following script to generate the account password #catpwd.pl#!/usr/bin/perlusestrict;my$pw=$ARGV[0];printcrypt

Jun 03, 2023 am 09:28 AM
nginx
How to use nginx for load balancing

How to use nginx for load balancing

Four-layer load balancing vs seven-layer load balancing. It is often said that seven-layer load balancing or four-layer load balancing is actually decided based on the name of the layer of the iso osi network model. nginx uses the http protocol to load the application layer. Balanced operation, so it is called seven-layer load balancing. For example, lvs that performs load balancing operations on the tcp layer is called layer 4 load balancing. Generally speaking, there are the following load balancing classifications: Common software support Common load balancing algorithms Common load balancing algorithms include the following: Load balancing demonstration example: ordinary polling Next, use nginx to demonstrate how to perform ordinary polling. : Prepare in advance to start two services on the two ports 7001/7002 for display.

Jun 03, 2023 am 08:19 AM
nginx

Hot tools Tags

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

vc9-vc14 (32+64 bit) runtime library collection (link below)

vc9-vc14 (32+64 bit) runtime library collection (link below)

Download the collection of runtime libraries required for phpStudy installation

VC9 32-bit

VC9 32-bit

VC9 32-bit phpstudy integrated installation environment runtime library

PHP programmer toolbox full version

PHP programmer toolbox full version

Programmer Toolbox v1.0 PHP Integrated Environment

VC11 32-bit

VC11 32-bit

VC11 32-bit phpstudy integrated installation environment runtime library

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Hot Topics

Java Tutorial
1652
14
PHP Tutorial
1251
29
C# Tutorial
1224
24