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

  • How to install and configure Docker nginx mounting
    How to install and configure Docker nginx mounting
    Download the nginx image in docker dockerpullnginxdockerimages Create the mounting directory mkdir-p/data/nginx/{conf, conf.d, html, logs} Write the nginx, conf configuration file and place it in the folder #formoreinformationonconfiguration, see: #*officialenglishdocumentation :http://nginx.org/en/docs/#*officialrussiandocumentation:http://ng
    Nginx 1018 2023-05-13 17:16:13
  • How to obtain the user's real IP address based on nginx reverse proxy
    How to obtain the user's real IP address based on nginx reverse proxy
    Introduction When nginx is used as a reverse proxy, the IP address obtained by the default configuration backend comes from nginx. Use request.getRemoteAddr(); to obtain the IP address of nginx, not the user's real IP. 1. Modify Nginx Configuration: server{listen80;server_namejenkins.local.com;location/{proxy_set_headerHost$host;proxy_set_headerX-Real-IP$remote_addr;proxy_passhttp://192.168.10.
    Nginx 3889 2023-05-13 17:07:12
  • How to solve nginx 503 Service Temporarily Unavailable error
    How to solve nginx 503 Service Temporarily Unavailable error
    Recently, the 503servicetemporarilyunavailable error often appears after the website is refreshed. Sometimes it is possible. I think of the recent restriction on the number of single IP accesses in nginx.conf, (limit_req_zone$binary_remote_addrzone=allips:20mrate=20r/s;) and enlarge this number before refreshing. Problems found and solved. (I also changed this to a larger limit_reqzone=allipsburst=50nodelay;) In order to confirm the problem, I repeatedly changed the number and tested it and found that the problem is indeed here. There is a problem if this number is set too small. Pass fid
    Nginx 6489 2023-05-13 16:22:06
  • What are the nginx-naxsi whitelist rules?
    What are the nginx-naxsi whitelist rules?
    Whitelist rule syntax: basicrulewl:id[negative][mz:[$url:target_url]|[match_zone]|[$args_var:varname]|[$body_vars:varname]|[$headers_var:varname]|[name]] wl:id (whitelistid) Which interception rules will enter the whitelist wl: 0 Add all interception rules to the whitelist wl: 42 Add the interception rule with id 42 to the whitelist wl: 42, 41, 43 Add ids 42, 41 and Add the interception rule 43 to the whitelist wl:-42 add all interception rules
    Nginx 1065 2023-05-13 16:19:14
  • How to use geoip for regional restrictions in nginx
    How to use geoip for regional restrictions in nginx
    Environment: nginxversion:nginx/1.14.0centosversion:centos7 The requirements are as follows: distinguish domestic or foreign countries through IP, so as to jump to different pages, and finally use nginx’s third-party module: geoip to achieve this, let alone its advantages. There are many explanations on the Internet. Let’s see how to configure it. My system is configured with nignx.repo. I directly used yum to install the geoip module. There is no need to add the module and reprogram it. yuminstallnginx-module-geoip downloads the geoip database file cd/ etc/nginxmkdirgeoipdatcdg
    Nginx 1483 2023-05-13 16:07:06
  • How to use Nginx to proxy multiple application sites in Docker
    How to use Nginx to proxy multiple application sites in Docker
    How to proxy (how do containers communicate)? Just use the proxy function of nginx directly (see related capabilities separately). The troublesome thing here is the communication between docker containers. There are four main methods of communication between docker containers: -Access through container IP: After the container is restarted, the IP will change. -Access through the host's ip:port method: If the host's IP changes, each application must be changed and the port must be bound, which is troublesome. - Establishing links through links: interdependence is too tight and is not conducive to maintenance. - Custom network: Containers in the same bridge network can access each other. Obviously, we will choose to customize the network so that related applications can link to the same
    Nginx 1981 2023-05-13 15:55:17
  • How to implement Nginx operation response header information
    How to implement Nginx operation response header information
    Prerequisite: The ngx_http_headers_module module needs to be compiled to support header information operations. add_header means adding custom header information to the response header. The instruction is add_headernamevalue[always];, which can be used in http{}, server{}, location {}, ifinlocation{} context, only takes effect when the response status code is equal to 200, 201 (1.3.10), 204, 206, 301, 302, 303, 304, 307 (1.1.16, 1.0.13), or 308 (1.13.0), if alw
    Nginx 1809 2023-05-13 15:31:19
  • How to deploy a react project in nginx
    How to deploy a react project in nginx
    Test item react-demo Clone your react-demo project to the server (by default, Github is used to manage our projects) If necessary, please install the project environment such as node.js, yarn, etc. Enter the project directory, execute npm to run the build, and start building the project. After a successful build, a dist folder will be generated (depending on your project configuration), and the static files in this folder will become the access files of our project. To configure Nginx, Linux server enter: /etc/nginx/sites-enabled, then as administrator, create a new configuration file for your react project such as react-demo.conf
    Nginx 1863 2023-05-13 15:28:23
  • How to configure Nginx reverse proxy using SSL
    How to configure Nginx reverse proxy using SSL
    Prerequisites 1. Backend Server: For the purpose of this tutorial, we are using tomcat server running on localhost on port 8080 Note: - When you start proxying requests, make sure that the application server is started. 2. SSL certificate: We also need to configure the SSL certificate on the server. We can use let'sencrypt's encryption certificate, you can get one using the program mentioned here. But for this tutorial, we will use a self-signed certificate, which can be created by running the following command from the terminal, $opensslreq-x509-nodes-days365-newkeyrsa:2048-keyout/etc
    Nginx 1471 2023-05-13 15:19:15
  • How to configure Nginx to implement encryption certificate access
    How to configure Nginx to implement encryption certificate access
    Enterprise use: Some enterprises require encryption of company data for security measures. Web encryption is also an important part, so you need to add a self-built certificate. Install the certificate. Remember three types of files, the basic CA certificate and the secondary CA certificate (containing some company personal information, used to identify the owner of the certificate), and then use this certificate to generate a real certificate for distribution and use. opensslgenrsa-des3-outca.key2048#ca level 1 private key (will require you to enter the password twice in succession, remember to keep it the same) opensslreq-new-keyca.key-outserver.csr#Level 2 encrypted file generated based on the private key (will Let's enter the private key password, CN, BJ, B
    Nginx 1503 2023-05-13 15:07:06
  • What is the method to install nginx plug-in files under Docker?
    What is the method to install nginx plug-in files under Docker?
    The purpose of the plug-in file: The file is not restricted by the docker image file. It can be modified, the container can be restarted, and the updated file can be used. It will not be restored by the image. Files such as logs and other information recorded during the running of the container can be automatically saved externally. In terms of storage, there are two ways to run the container without losing it due to container restart: dockerrun command docker-compose command dockerrun command method, use the -v parameter to mount the external host directory to the path inside the container, there are multiple mount points , it is specified through multiple -v parameters, and only absolute paths can be used; the docker-compose command is easy to describe through service. To be precise, a service can be included
    Nginx 1770 2023-05-13 15:04:12
  • How to add Nginx to system service in CentOS7
    How to add Nginx to system service in CentOS7
    To view services, first check the service status of nginx and enter systemctlstatusnginx. The result is as follows: no relevant services were found. The next step is to add system services. Add system service Add nginx.service in the /usr/lib/systemd/system directory and modify it according to the actual situation. For detailed analysis, please see the article in the reference materials below. The content is as follows [unit]description=nginx-highperformancewebserverdocumentation=http://nginx.org/en/docs/after=network
    Nginx 1158 2023-05-13 14:49:06
  • How does Nginx solve the 404 problem of page refresh in history mode?
    How does Nginx solve the 404 problem of page refresh in history mode?
    The pre-knowledge single-page application (SPA-singlepage application) only returns the unique html page and its public static resources when the page is loaded for the first time. Subsequent page jumps will not get the html file from the server. (Hash and history routing implement browser URL changes without refreshing the page) Hash routing example: www.baidu.com/#/home. Originally hash is used to control the page view in combination with anchor points. When the value after # changes The page will not be re-requested, which is mainly achieved through the window's onhashchange method. Compared with hash routing, the most intuitive change of history routing is
    Nginx 2607 2023-05-13 14:40:11
  • How to build a picture server on Linux platform through nginx and vsftpd
    How to build a picture server on Linux platform through nginx and vsftpd
    1. nginx installation 1. nginx installation environment nginx is developed in C language. It is recommended to run on Linux. This tutorial uses centos6.5 as the installation environment. To install nginx, you need to compile the source code downloaded from the official website first. The compilation depends on the gcc environment. If there is no gcc environment, you need to install gcc: yuminstallgcc-c++pcre (perlcompatibleregularexpressions) is a perl library, including a perl-compatible regular expression library. The http module of nginx uses pcre to parse regular expressions, so the pcre library needs to be installed on Linux. yuminsta
    Nginx 1410 2023-05-13 14:28:12
  • How to configure Nginx page jump according to different browser languages
    How to configure Nginx page jump according to different browser languages
    Simplified and Traditional Chinese I want to decide whether to provide simplified or traditional Chinese files based on the accept-language in the http header. In chrome, chrome://settings/languages ​​can set the preferred language, and the browser will set the accept-language header accordingly. A better way to handle it is to parse the field, obtain the qvalue, and select the most appropriate language based on priority. But it is only used to support Simplified and Traditional Chinese. I want to use a trick: ignore the priority. As long as the words zh-hant, zh-tw, zh-hk, etc. appear in accept-language, return to Traditional Chinese, otherwise return to Simplified Chinese. map$http_accep
    Nginx 1107 2023-05-13 13:37:11

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!