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

  • How to configure and test virtual domain names in Nginx environment
    How to configure and test virtual domain names in Nginx environment
    Using nginx virtual domain name configuration, you can access the local server through a specific domain name without purchasing a domain name. Reduce unnecessary expenses before launch. Configuration steps 1. Edit the nginx.conf configuration file sudovim/usr/local/nginx/nginx/conf/nginx.xonf (1) Add the domain name to the file name (to facilitate future management). The code added here is http in nginx.conf Just add it under the node. But you need to pay attention to the path of the vhost folder. The path of the vhost folder created here is: /usr/local/nginx/nginx/conf/vhost, but ng
    Nginx 1516 2023-05-14 16:22:06
  • How docker nginx deploys multiple projects
    How docker nginx deploys multiple projects
    Prerequisites 1. Docker has been installed on the local computer and server. You can download it on Google. 2. Already have an account on dockerhub and register for the portal: 3. You need to be familiar with docker and understand some instructions in dockerfile. Use dockerfile to create Mirror If there is a project called web on this machine, create a new dockerfile in the web root directory and write the following content fromnginx:1.13.6-alpinelabelmaintainer="lilywang"argtz="asia/shanghai"envtz${tz}
    Nginx 1266 2023-05-14 16:16:12
  • How to use Docker to deploy Nginx+Flask+Mongo applications
    How to use Docker to deploy Nginx+Flask+Mongo applications
    nginx is used as the server, mongo is the database support, and flask is the web framework of the python language. Using the container features of docker, it can be simply deployed on the Linux server. The main directory of the project preparation project is as follows __project-name|__docker-file|__ningx|__dockerfile |__conf|__nginx.conf|__flask|__dockerfile|__requirements.txt|__mongo|__dockerfile|__setup.sh|__docker-compose.yml|
    Nginx 1232 2023-05-14 16:16:06
  • How can Nginx efficiently deploy multiple sites on one server?
    How can Nginx efficiently deploy multiple sites on one server?
    Let's take a look at our needs. I have three website projects here that need to be deployed (corresponding to three domain names in turn). A Linux server is provided to enable access to the corresponding domain name to jump to the corresponding website. Let's take a look at the architecture diagram I designed to solve this problem: Here we assume that the public IP address of the Linux server in the diagram is 192.168.2.100, and then assume that we want to build three sites on this server: www.nginxtest.net , admin.nginxtest.net, app.nginxtest.net. Okay, let’s configure it in detail: 1. To configure nginx reverse proxy, we still connect to ssh first, and then enter
    Nginx 2540 2023-05-14 16:13:06
  • How to use shared memory in nginx
    How to use shared memory in nginx
    The use of ngx_shmem. The ngx_shmem.c/h file is just a very simple encapsulation of the mmap()/munmap() system call or shmget()/shmdt(). Implemented the ngx style basic library, which can apply for and release a continuous shared memory space. It is generally used for fixed-length shared data. The data length is fixed and will not expand or shrink during use. typedefstruct{u_char*addr;size_tsize;...}ngx_shm_t;ngx_int_tngx_shm_alloc(ngx_shm_t*shm);voidngx_shm_free(ngx
    Nginx 1328 2023-05-14 15:55:06
  • How to install PHP and Nginx on Centos7
    How to install PHP and Nginx on Centos7
    1. Install PHP. As WeChat became popular in 2013, the use of PHP has also become popular again. Many companies on the market have chosen to use PHP as their application backend. Personally, I think the reasons are: 1. The cost of PHP is low. 2. PHP is easy to get started with. 3. The development cycle of PHP is relatively short. 4. The birth of TP5 has improved the efficiency of PHP interface development. Because there are so many demands, many companies' server configurations need to be able to support the PHP environment to complete project construction. In fact, there are generally two types of centos installation software. The first is quick installation and the second is compilation and installation. I personally recommend compilation and installation. As for the quick installation method, it is simple and fast. Just load the corresponding php source and complete one step through yuminstall.
    Nginx 1787 2023-05-14 15:37:06
  • How Nginx and GeoIP modules read the geographical information of IP
    How Nginx and GeoIP modules read the geographical information of IP
    Linux installation geoipyuminstallnginx-module-geoiphttp_geoip_module usage scenario 1. Differentiate http access rules at home and abroad 2. Differentiate http access rules in domestic cities and regions After yum is installed, find the installed module file. If nginx is installed with yun, it is usually installed to /etc Note in the /nginx/modules/ directory: If nginx is not installed by yum but compiled and installed from source code, you need to reinstall and compile nginx and add this module, and then you do not need to add this module manually. Manually add the module and load the module and http at the head of the nginx.conf configuration file.
    Nginx 1711 2023-05-14 15:10:06
  • How to configure nginx with ssl to achieve https access
    How to configure nginx with ssl to achieve https access
    Apply for a certificate here. I directly applied for a free certificate from Tencent Cloud. It should be noted here that the free certificate issued by the Asian Trust Agency can only be used for one domain name, and sub-domain names need to be applied for separately. Not to mention, the application in Tencent is quite fast, and it was approved in more than ten minutes. Download a zip file, unzip it, open the nginx folder inside, and copy the 1_xxx.com_bundle.crt and 2_xxx.com.key files. Open the nginx configuration file. If you don’t know the location of the nginx file, you can use the whereisnginx command to find it. My configuration file is in /ect/nginx. Now copy the two certificate files just now and configure them directly later.
    Nginx 1186 2023-05-14 15:07:14
  • How to install Nginx and configure automatic startup on CentOS7
    How to install Nginx and configure automatic startup on CentOS7
    1. Download the installation package from the official website and select the version suitable for Linux. Select the latest version here, download it locally and then upload it to the server or download it directly with the wget command under centos. Switch to the /usr/local directory and download the software package #cd/usr/local#wgethttp://nginx.org/download/nginx-1.11.5.tar.gz2. To install nginx, first execute the following command to install the nginx dependent library. If dependent libraries are missing, the installation may fail. For details, please refer to the error message at the end of the article. #yuminstallgcc-c++#yuminstallpcre#yumins
    Nginx 3062 2023-05-14 15:01:14
  • How to redirect https through nginx load balancing
    How to redirect https through nginx load balancing
    Copy the certificate and key on the web side scp-rp-p52113/application/nginx/conf/key10.0.0.5:/application/nginx/conf/ Configure vim/application/nginx/conf/nginx.confworker_processes2 on the nginx load balancing server ;error_loglogs/error.log;events{worker_connections65535;}http{includemime.types;default_typeappli
    Nginx 981 2023-05-14 14:58:23
  • How to enable Nginx directory browsing function
    How to enable Nginx directory browsing function
    We all know that under apache, you can configure it to automatically display the file list under the directory when accessing a certain path of the web server. In fact, nginx is not weaker than apache at all. Of course, it can also achieve this function, and it is very easy and simple; The autoindex parameter is mainly used to enable it. Its configuration is as follows: Copy the code as follows: location/{root/data/www/file//Specify the absolute path of the actual directory; autoindexon;//Enable directory browsing function; autoindex_exact_sizeoff;//Close Detailed file size statistics, let the file size display in mb, gb units, the default is b; a
    Nginx 1368 2023-05-14 13:46:06
  • How to customize logging and enable log buffer in Nginx
    How to customize logging and enable log buffer in Nginx
    Access log nginx writes information about a client's request in the access log immediately after processing the request. By default, the access log is located in logs/access.log, and information is written to the log in a predefined combination format. If you want to accurately record access information, you need to customize a more complete access log format, as shown below: http{log_formatgeoproxy'[$time_local]$remote_addr''$realip_remote_addr$remote_user''$request_m
    Nginx 988 2023-05-14 13:07:33
  • How to configure keepalived dual-machine hot standby nginx
    How to configure keepalived dual-machine hot standby nginx
    Environment preparation: 2 centos: 192.168.0.105 and 192.168.0.118, the virtual IP (vip) is 192.168.0.119, configure keepavlived. Install keepalivedyuminstallkeepalived on 105 and 118 respectively. Prepare the heartbeat script. The configuration of keepalived is quite flexible, and the script command can be executed regularly. , used for heartbeat check. For example, when we access nginx and find that nginx is inaccessible, we turn off keepalived, thereby switching to nginx to achieve uninterrupted service support. vi/etc/keepalived
    Nginx 1155 2023-05-14 12:34:11
  • Nginx quick start example analysis
    Nginx quick start example analysis
    Why use nginx? At present, the main competitor of nginx is apache. Here I will make a simple comparison between the two to help everyone better understand the advantages of nginx. 1. As a web server: Compared with apache, nginx uses fewer resources, supports more concurrent connections, and reflects higher efficiency. This makes nginx especially popular with virtual host providers. In the case of high connection concurrency, nginx is a good substitute for the apache server: nginx is one of the software platforms often chosen by bosses in the virtual host business in the United States. It can support responses of up to 50,000 concurrent connections. Thanks to nginx for We chose epollan
    Nginx 855 2023-05-14 12:19:20
  • How to quickly install Nginx server on CentOS
    How to quickly install Nginx server on CentOS
    1. Download nginx Download the latest version of nginx from the official website of nginx (http://nginx.org/en/download.html). Here I downloaded nginx-1.9.12. After the download is completed, you will get a compressed package as shown in the figure below. Upload the tar package of nginx to the Linux server, as shown in the figure below: 2. Install nginx2.1. Installation prerequisites. Before installing nginx, you need to ensure that g++ and gcc are installed on the system. , openssl-devel, pcre-devel and zlib-devel software. 1. Install necessary software: yum-yinstallzli
    Nginx 895 2023-05-14 12:04: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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!