Article Tags
How to configure Nginx second-level domain name

How to configure Nginx second-level domain name

When a domain name needs to be used on two projects, we need to use the second-level domain name. Configure the second-level domain name in Nginx as follows: 1. The original configuration file is as follows worker_processes1;events{worker_connections1024;}http{includemime.types;default_typeapplication /octet-stream;sendfileon;keepalive_timeout65;server{listen80;server_namelocalhost;location/{roothtm

May 12, 2023 pm 11:22 PM
nginx
How to build a load balancing server based on Centos7+Nginx+Tomcat8

How to build a load balancing server based on Centos7+Nginx+Tomcat8

After manually installing nginx, everything is normal, and there are no problems with the configuration of the virtual host and load balancing. It was successfully enabled. The specific configuration file is as follows: Added: includevhost/*.conf; to the nginx.conf file of conf to introduce all the .conf files in the vhost directory. In order to make it easy to configure in the future, of course, if necessary, You can also add them one by one. Because the load service is an api service, the name of the conf file here is called api.xxx.com.conf. The configuration of opening the file is as follows: The ip polling method is not used here, but the usstream method is used. Specifically What is the difference between these methods?

May 12, 2023 pm 11:16 PM
nginx centos7 tomcat
How nginx implements database port forwarding

How nginx implements database port forwarding

For data security reasons, under normal circumstances, external network access is generally prohibited for websites or project databases, or access is only allowed to some hosts. So, how can we allow other hosts that are prohibited from accessing to access this database without modifying such permissions? At this time, the role of Nginx is reflected. 1. For mysql, for example, the database configurations such as oracle and sqlserver are the same as the following configurations, except that the database ports are different. It should be noted that this configuration must be written outside http. #Use nginx for database port forwarding stream{upstreamsql{#Configure the IP of the database. and port server172.16.8.190:3306w

May 12, 2023 pm 11:13 PM
数据库 nginx
How to configure Nginx anti-hotlinking

How to configure Nginx anti-hotlinking

Experimental environment • A minimally installed centos7.3 virtual machine • Configuration: 1 core/512mb • nginx version 1.12.2 1. Configure hotlink websites 1. Start an nginx virtual machine and configure two websites vim/etc/ nginx/conf.d/vhosts.conf add the following content server{listen80;server_namesite1.test.com;root/var/wwwroot/site1;indexindex.html;location/{}}server{listen80;server_namesite2.test.

May 12, 2023 pm 11:04 PM
nginx
How to use gzip compression in nginx to improve website speed

How to use gzip compression in nginx to improve website speed

Why use gzip compression? Turn on nginx's gzip compression. The size of static resources such as js and css in the web page will be greatly reduced, thereby saving a lot of bandwidth, improving transmission efficiency, and giving users a faster experience. nginx implements gzip The principle of nginx to implement resource compression is to intercept requests through the default integrated ngx_http_gzip_module module, and perform gzip on the types that need to be gzip. It is very simple to use and can be turned on directly, just set the options. . Request headers and response headers after gzip takes effect requestheaders:accept-encoding:gzip,deflate,sdchresponseheaders:

May 12, 2023 pm 10:34 PM
nginx gzip
How to configure Nginx ssl certificate to achieve https secure access

How to configure Nginx ssl certificate to achieve https secure access

The prerequisite is that you have a server and your own domain name that can be resolved to the server. 1. Nginx installation and configuration If you have installed Nginx, you need to check whether your Nginx has the SSL module function enabled: ./nginx-V is displayed as above, which means that the SSL function is enabled, otherwise the following error message may appear: nginx:[emerg]the"ssl"parameterrequiresngx_http_ssl_modulein/usr/local/nginx.conf:%Installation steps 1. Download the nginx compressed package from the official website nginx:download Let's go to the official website to download it first

May 12, 2023 pm 10:28 PM
HTTPS ssl nginx
How to solve linux nginx not parsing php

How to solve linux nginx not parsing php

Solution to linuxnginx not parsing php: 1. Check whether port 9000 is in listening state; 2. Check the "php-fpm.conf" file; 3. Modify the nginx configuration to "location~\.php${fastcgi_passunix:/dev /shm/php-cgi.sock;#127.0.0.1:9000fastcgi_indexindex..." can be used. Solution to nginx not parsing php file 502: The installed nginx listens to port 9000 by default. Check whether port 9000 is in listening state netstat-antp|grep:9000

May 12, 2023 pm 10:19 PM
Linux PHP nginx
How to deploy your own django project with nginx+uwsgi

How to deploy your own django project with nginx+uwsgi

Step 1: Change the source. Enter the command to replace the Ubuntu download source sudonano/etc/apt/sources.list. Replace all the following files with the original files. I am using the Alibaba source here. You can also change to other sources. debhttp://mirrors.aliyun.com/ubuntu/bionicmainrestricteddebhttp://mirrors.aliyun.com/ubuntu/bionic-updatesmainrestricteddebhttp://mirrors.aliyun.com/ubuntu/bionicunive

May 12, 2023 pm 10:10 PM
nginx django uwsgi
How to configure Nginx timeout timeout

How to configure Nginx timeout timeout

keepalive_timeouthttp has a keepalive mode, which tells the webserver to keep the TCP connection open after processing a request. If it receives other requests from the client, the server will use this unclosed connection without establishing another connection. httpkeep-alive, every request on the web page is http (pictures, css, etc.), and to open an http request, you must first establish a tcp connection. If a page needs to open and close a tcp connection for each request, it will become a resource. The waste of keepalive_timeout is that when an http request is completed, its tcp connection will remain

May 12, 2023 pm 10:07 PM
nginx timeout
How to implement kibana login authentication through Nginx reverse proxy

How to implement kibana login authentication through Nginx reverse proxy

Install the ApacheHttpd password generation tool $yuminstallhttpd-tools-y to generate the Kibana authentication password $mkdir-p/usr/local/nginx/conf/passwd$htpasswd-c-b/usr/local/nginx/conf/passwd/kibana.passwdUserrenwolecomGN5SKorJAddingpasswordforuserUserrenwolecom configure Nginx reverse Add the following content to the proxy in the Nginx configuration file (or include it in a new configuration file): $vim/us

May 12, 2023 pm 10:01 PM
nginx kibana
How to implement nginx front-end distribution based on $remote_addr

How to implement nginx front-end distribution based on $remote_addr

The requirements are as follows: There are multiple servers under the domain name. Now we are testing for a certain region. Let IP users in a certain region only access a certain server and do the test separately. If there are no problems, update them all; if there are problems, the impact will be small. Find problems in time and solve them; Solution: Use the nginx module to configure matching rules on the front-end load balancing forwarding machine; nginx configures vhost, in the location section under the domain name, add a piece of code. If $remote_addr matches the ip, forward it to abc_test_server;server{listen80;server_nameabc.com.cn;access_log/dev/

May 12, 2023 pm 10:01 PM
nginx
How to solve the conflict between nginx and backend port

How to solve the conflict between nginx and backend port

Problem: When I started the development environment of the Alice management system, I found that all interfaces in the background all generated 404 errors during the first request, but the second request successfully located the problem. I checked the nginx error log and found the following error, so I mistakenly thought The error occurred because the file in the html folder could not be written due to insufficient permissions. So after opening the permissions, I found that it still didn't work. After searching on Google, I still couldn't find a solution. I put it aside for the time being, and when I tried to find the error again the next day, I accidentally opened port 8081. When you accessed localhost:8081 and 127.0.0.1:8081, the contents were actually different. At that time, I realized that there was a port conflict, so I opened the file and found the conf of nginx.

May 12, 2023 pm 09:52 PM
nginx
How to implement Nginx dynamic and static separation configuration

How to implement Nginx dynamic and static separation configuration

1. Overview 1.1 The difference between dynamic pages and static pages Static resources: When users access this resource multiple times, the source code of the resource will never change. Dynamic resources: When a user accesses this resource multiple times, the resource's source code may undergo changes. 1.2 What is dynamic and static separation? Dynamic and static separation allows dynamic web pages in dynamic websites to distinguish constant resources from frequently changing resources according to certain rules. After dynamic and static resources are split, we can separate them according to the characteristics of static resources. It does caching operations, which is the core idea of ​​static website processing. The simple summary of dynamic and static separation is: the separation of dynamic files and static files. Pseudo-static: If the website wants to be searched by search engines, dynamic page static technology such as freemarker and other template engine technologies 1.

May 12, 2023 pm 09:25 PM
nginx
How to install Nginx+PHP under Windows system

How to install Nginx+PHP under Windows system

Step 1. Download Nginx. First, you need to download the Nginx installation package from the official website of Nginx. You can visit http://nginx.org/ or click here directly to download the latest version. After downloading, extract it to a local directory, such as D:\nginx. Step 2. Download PHP. Then you need to download the PHP installation package from the official website of PHP. You can visit https://www.php.net/ or click here directly to download the latest version. Select the Windows version of the ZIP package to download. After downloading, extract it to a local directory, such as D:\php. Step 3. Configure Nginx and PHP Next you need to configure Nginx and PHP. Find Ng first

May 12, 2023 pm 09:16 PM
Windows PHP 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
1659
14
PHP Tutorial
1258
29
C# Tutorial
1232
24