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

  • How to solve the 403 problem caused by nginx configuration
    How to solve the 403 problem caused by nginx configuration
    Solutions to 403 problems caused by nginx configuration 1. Problem: 403nginx_error.log log appears when curlnginx configures the local domain name as follows: 2. Question 1. www.requesturi.com is configured as follows: access is prohibited in the root directory and error log. The files are inconsistent. In theory, when accessing www.requesturi.com, you should search in /usr/local/nginx/html1. Why does it show that access to /usr/local/nginx/html is indeed prohibited? 2. Curl an a.txt file under /usr/local/nginx/html1
    Nginx 2270 2023-06-01 16:25:06
  • How to modify Nginx files with centos7 docker
    How to modify Nginx files with centos7 docker
    1. Install nginx with docker: It is very simple to install nginx with docker. 2. After installation, enter the docker container: execute the command: dockerexec-it container idbash. Note that the container must be open to enter. 3. Take modifying index.html of nginx as an example: 1. Enter the directory where the index is located: cdusr/share/nginx/html 2. Edit index.html, the key point is that an error will be reported here, as follows 3. It will prompt that there is no vim command, install it This command: apt-getinstallvim If unsuccessful, update the apt-get command: apt-getup
    Nginx 1322 2023-06-01 09:31:07
  • Nginx high availability method
    Nginx high availability method
    Preparation work: 192.168.16.128 192.168.16.129 Two virtual machines. Install Nginx Install Nginx Update yum source file: rpm-ivhhttp://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm wget-O /etc/yum.repos.d/CentOS-Base.repohttp://mirrors.aliyun.com/repo/Cent
    Nginx 1471 2023-05-31 15:04:06
  • How to write nginx automation script
    How to write nginx automation script
    This script can satisfy the operations of starting, stopping and restarting nginx#!/bin/bash./etc/init.d/functionsfunctionusage(){echo$"usage:$0{start|stop|restart}"exit1}functionstart() {/usr/local/nginx/sbin/nginxsleep1if[`netstat-antlpe|grepnginx|wc-l`-ge0];thenaction"nginxisstarted.&quot
    Nginx 1706 2023-05-31 14:37:06
  • How to deploy Nginx https website and configure address rewriting
    How to deploy Nginx https website and configure address rewriting
    1. Environment preparation: One centos6.9 host, turn off the firewall and selinux. Install dependency packages: yum-yinstallopenssl-develpcre-develgcc. Create nginx user: useradd-m-s/sbin/nologinnginx#Do not create a home directory for nginx users, and there is no interaction shelltar-xfnginx-1.8.0.tar.gzcdnginx-1.8.0./configure--user=nginx--group=nginx--prefix=/usr/local/nginx--with-h
    Nginx 1608 2023-05-31 12:53:12
  • How to configure Nginx to detect service status
    How to configure Nginx to detect service status
    1. Check whether the check status module is installed; [root@localhost~]#nginx-vnginxversion:nginx/1.12.2builtbygcc4.8.520150623(redhat4.8.5-36)(gcc)configurearguments:--prefix=/usr/local/nginx- -with-http_sub_module2. If not installed, recompile and install; øcheck status module; --with-http_stub_status_module[root@localh
    Nginx 2328 2023-05-31 11:13:06
  • How to set the access_log log of nginx
    How to set the access_log log of nginx
    There are two main instructions for nginx logs: 1) log_format: used to set the log format; 2) access_log: used to specify the storage path and format of the log file log_format log format 1. Syntax: log_formatname (format name) format style (that is, what you want What kind of log content is obtained) Example: log_formatmain'$remote_addr-$remote_user[$time_local]"$request"''$status$body_bytes_sent&
    Nginx 2985 2023-05-31 10:28:29
  • How to use Nginx reverse proxy to solve cross-domain problems
    How to use Nginx reverse proxy to solve cross-domain problems
    The problem is in the article about cross-domain resource sharing shared before. It is mentioned that when cross-domain, if you want to send cookies, access-control-allow-origin cannot be set to *. It must be specified clearly and consistent with the requested web page. domain name. I encountered such problems when collaborating with others during the development of this project. Generally speaking, the solution is to use cors cross-domain resource sharing with the backend to set access-control-allow-origin to the domain name visited. This requires the cooperation of the backend, and some browsers do not support it. Based on the cooperation with the partner's backend, the nginx direction proxy is used to satisfy the browser's same-origin policy to implement the cross-domain implementation method reverse proxy concept.
    Nginx 7062 2023-05-31 10:20:30
  • What is the upstream configuration and function of nginx?
    What is the upstream configuration and function of nginx?
    Configuration example upstreambackend{serverbackend1.example.comweight=5;serverbackend2.example.com:8080;serverunix:/tmp/backend3;serverbackup1.example.com:8080backup;serverbackup2.example.com:8080backup;}server{location/{proxy_passhttp ://backend;}}Command syntax: upstreamname{.
    Nginx 2563 2023-05-30 22:28:04
  • How to configure Nginx virtual host on CentOS
    How to configure Nginx virtual host on CentOS
    Experimental environment A minimally installed centos7.3 virtual machine configures the basic environment 1. Install nginxyuminstall-yepel-*yumisntall-ynginxvim 2. Establish the site root directory of the virtual machine host mkdir/var/wwwrootmkdir/var/wwwroot/site1mkdir/var/ wwwroot/site2echo-e"site1">>/var/wwwroot/site1/index.htmlecho-e"site2">>/var/
    Nginx 1409 2023-05-30 21:45:29
  • How to configure nginx page cache
    How to configure nginx page cache
    nginx page cache 1. Instruction description proxy_cache_path syntax: proxy_cache_pathpath[levels=number]keys_zone=zone_name:zone_size[inactive=time][max_size=size]; Default value: none Usage field: http directive specifies the cache path and some other parameters , the cached data is stored in a file, and the hash value of the proxy url is used as the key and file name. The levels parameter specifies the number of cached subdirectories, for example: proxy_cache_path/data/nginx/ca
    Nginx 3001 2023-05-30 19:13:30
  • How to configure nginx log access_log
    How to configure nginx log access_log
    The access log of the web server is very important. We can analyze the user's access through the access log, and we can also find some abnormal access, such as CC attacks, through the access log. Format: access_log/path/to/logfileformat; access_log can be configured in the http, server, and location configuration sections. Configuration example: server{listen80;server_namewww.xxx.com;root/data/wwwroot/www.xxx.com;indexindex.htmlindex.php;access_lo
    Nginx 2566 2023-05-30 18:28:06
  • How to use Nginx web server caddy
    How to use Nginx web server caddy
    Introduction to Caddy Caddy is a powerful and highly scalable web server that currently has 38K+ stars on Github. Caddy is written in Go language and can be used for static resource hosting and reverse proxy. Caddy has the following main features: Compared with the complex configuration of Nginx, its original Caddyfile configuration is very simple; it can dynamically modify the configuration through the AdminAPI it provides; it supports automated HTTPS configuration by default, and can automatically apply for HTTPS certificates and configure it; it can be expanded to data Tens of thousands of sites; can be executed anywhere with no additional dependencies; written in Go language, memory safety is more guaranteed. First of all, we install it directly in CentO
    Nginx 2470 2023-05-30 12:19:45
  • How to limit the number of connections in nginx speed limit
    How to limit the number of connections in nginx speed limit
    Scenario: Company A has 100 people, and Company A only has one public IP. Assume that Company A may have 100 people downloading your website files at the same time. However, your connection limit configuration is: limit_conn_zone$binary_remote_addrzone=perip:1m;server{---limit_connperip1;limit_rate1024k;---} allows a single connection number, and the maximum bandwidth of a single connection is 1m. In this way, there will be 99 people with a request status of 503. Others must wait manually if they want to download (nginx will not notify users that user a has finished downloading, and it is your turn to download user b). The use caused by this
    Nginx 993 2023-05-30 11:19:05
  • How to use Nginx_geo module to implement CDN scheduling
    How to use Nginx_geo module to implement CDN scheduling
    To introduce the geo module of nginx, the geo instruction is provided by the ngx_http_geo_module module. By default, nginx loads this module unless artificially --without-http_geo_module. The ngx_http_geo_module module can be used to create variables whose values ​​depend on the client IP address. The usage is as follows: geo command syntax: geo[$address]$variable{...} Default value: - Configuration section: http definition obtains the client's IP address from the specified variable. By default, nginx gets the client ip address from the $remote_addr variable, but it can also
    Nginx 1413 2023-05-30 10:27:18

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!