current location:Home > Technical Articles > Operation and Maintenance > Nginx
- Direction:
- All web3.0 Backend Development Web Front-end Database Operation and Maintenance Development Tools PHP Framework Daily Programming WeChat Applet Common Problem Other Tech CMS Tutorial Java System Tutorial Computer Tutorials Hardware Tutorial Mobile Tutorial Software Tutorial Mobile Game Tutorial
- Classify:
-
- How to enable SSL configuration in Nginx server
- To generate a certificate, you can generate a simple certificate by following the following steps: First, enter the directory where you want to create the certificate and private key, for example: $cd/usr/local/nginx/conf to create the server private key. The command will ask you to enter a password: $opensslgenrsa-des3-outserver.key1024 Create certificate (csr) for signing request: $opensslreq-new-keyserver.key-outserver.csr Remove necessary password when loading nginx with ssl support and use the above private key: $cpserver.keyserver .key.org$opensslrsa
- Nginx 1526 2023-06-03 15:12:09
-
- Docker runs nginx using daemon off instance analysis
- Question 1. Why does the docker container hang when it is running? By default, the docker container will use the first process inside the container, that is, the program with pid=1, as the basis for whether the docker container is running. If the docker container pid hangs, the docker container will exit directly. 2. When docker runs, use command as the internal command of the container. If you use nginx, then the nginx program will run in the background. At this time, nginx is not the program with pid 1, but the executed bash. This bash will hang after executing the nginx command. , so the container also exited. The same reason as yours. After pm2start, bash
- Nginx 1733 2023-06-03 14:04:12
-
- 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
- Nginx 1638 2023-06-03 13:36:14
-
- 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/
- Nginx 1090 2023-06-03 13:18:14
-
- 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
- Nginx 2080 2023-06-03 13:13:04
-
- 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.
- Nginx 1078 2023-06-03 12:41:53
-
- 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
- Nginx 1975 2023-06-03 12:31:44
-
- 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
- Nginx 1002 2023-06-03 12:31:03
-
- 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.
- Nginx 1371 2023-06-03 11:55:28
-
- 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
- Nginx 1679 2023-06-03 10:59:17
-
- 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.
- Nginx 1300 2023-06-03 10:16:32
-
- 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/':
- Nginx 1535 2023-06-03 10:05:25
-
- 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
- Nginx 4437 2023-06-03 09:52:43
-
- 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
- Nginx 1575 2023-06-03 09:40:10
-
- 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
- Nginx 812 2023-06-03 09:28:22