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

  • How to set up Nginx domain name forwarding to a specified port
    How to set up Nginx domain name forwarding to a specified port
    Enter /usr/local/nginx/confsudocd/usr/local/nginx/conf to create the vhost directory sudomkdirvhost and modify the nginx.conf file sudocpnginx.confnginx.conf_backsudovimnginx.conf to set the hosts file of the access machine for simulated access. The machine I use here is Windows 10, the hosts file is in the c:\windows\system32\drivers\etc folder. Create port proxy configuration file sudocdvhostsudovimww
    Nginx 2011 2023-05-14 21:37:12
  • How to modify the Nginx version name to disguise any web server
    How to modify the Nginx version name to disguise any web server
    How to modify the default name of nginx, you can disguise it a little, or you can install Tip: Generally, modifications are made before nginx is compiled. After modification, the code needs to be recompiled as follows: scr/core/nginx.conf#definenginx_version"1.4.7"#definenginx_ver"nginx/"n
    Nginx 1155 2023-05-14 21:19:12
  • How to highlight NGINX configuration files in VIM
    How to highlight NGINX configuration files in VIM
    Download nginx.vim. Here we take the Linux system as an example. Other systems are similar. Switch to vim's syntax configuration directory and download the nginx syntax file. It should be noted that vim74 in the path needs to correspond to the vim version number installed on the machine. cd/usr/share/vim/vim74/syntax&&wget-onginx.vimhttps://vim.sourceforge.io/scripts/download_script.php?src_id=19394Configure filetype.vimEdit the filetype.vim file to register nginx
    Nginx 1429 2023-05-14 21:16:10
  • How to solve the 403 forbidden error reported by Nginx
    How to solve the 403 forbidden error reported by Nginx
    There are usually three situations that cause nginx403forbidden: one is the lack of index files, the other is permission issues, and the third is selinux status. 1. The index.html or index.php file is missing, which is the file specified in the indexindex.htmlindex.htm line in the configuration file server{listen80;server_namelocalhost;indexindex.phpindex.html;root/var/www;} if it is in / When there is no index.php or index.html under var/www, the file cannot be found when accessing the domain name directly.
    Nginx 15847 2023-05-14 21:13:11
  • How to solve the problem that docker nginx cannot be accessed after running
    How to solve the problem that docker nginx cannot be accessed after running
    ##1 I am learning docker deployment recently, and I initially planned to dockerize nginx first. For comparison, after customizing the configuration and copying the official nginx.conf, I modified and added some customizations, mainly blocking the default.conf and the include folder sites-available#include/etc/nginx/conf.d/. conf;include/etc/nginx/sites-available/;Official original configuration usernginx;worker_processes1;error_log/var/log/nginx/e
    Nginx 1316 2023-05-14 21:01:09
  • How to solve nginx error when using rewrite
    How to solve nginx error when using rewrite
    Description of the Problem Since my English is not very good, I looked at the help document and found one that starts with without and one that starts with disable. I added the module that starts with without without thinking, and the nightmare began. When I configured the file, I was still confident./sbin/nginx-t checked the syntax, eh? An error was reported. As expected, it might be that the configuration there was wrong. But when I checked it over and over again, I started to panic. Cause analysis: First of all, according to the prompts, we know that nginx cannot parse rewrite (unknown command "rewrite"). I think the module is not installed, or its dependencies pcre and pcre-devel are not installed (when everyone checked
    Nginx 1535 2023-05-14 20:52:04
  • How to configure nginx reverse proxy
    How to configure nginx reverse proxy
    nginx reverse proxy Before configuring nginx reverse proxy, we must first prepare two test servers, web1 and web2. 1. Install httpd[root@web1~]#yuminstall-yhttpd[root@web2~]#yuminstall-yhttpd2 .Provide test page[root@web1~]#echo"web1.test.com">/var/www/html/index.html[root@web2~]#echo"web2.test.com">/var/www /
    Nginx 5273 2023-05-14 20:40:10
  • How to modify the nginx site root directory
    How to modify the nginx site root directory
    1. Modify the nginx configuration file command vi/usr/local/nginx/conf/nginx.conf to modify two places in it. 2. Many people have modified this and uploaded files in the ftp tool, such as index.html, but it shows 404notfound and now it is bad. The first part is to modify the permissions of the folder. The access permissions of the folder are not enough, so it cannot be accessed by IP or domain name. Solution: Use the command to enter the root directory of your site and enter the command chmoda+w. On his Use the ll command to check the permissions at the first level. If it is the same as above, it is correct. It is best to set all superior directories of the website root directory to this permission. Otherwise, you may have root directory permissions.
    Nginx 2800 2023-05-14 20:37:16
  • How to use Nginx and Nginx Plus to resist DDOS attacks
    How to use Nginx and Nginx Plus to resist DDOS attacks
    1. Characteristics of application layer DDoS attacks. Application layer (seventh layer/http layer) DDoS attacks are usually initiated by Trojan horse programs, which can be designed to better exploit the vulnerabilities of the target system. For example, for a system that cannot handle a large number of concurrent requests, just by establishing a large number of connections and periodically sending out a small number of data packets to maintain the session, the system's resources can be exhausted, making it unable to accept new connection requests to achieve the purpose of DDoS. Other attacks include sending a large number of connection requests to send large data packets. Because the attack is initiated by a Trojan horse program, the attacker can quickly establish a large number of connections and issue a large number of requests in a short period of time. The following are some DDoS characteristics. We can use these characteristics to resist DDoS (including
    Nginx 1162 2023-05-14 20:34:04
  • How to use dockerfile to build nginx image
    How to use dockerfile to build nginx image
    Introduction to dockerfile Docker can automatically build an image by reading the contents of the dockerfile. The dockerfile is a text file that contains all the commands that need to be executed during the build process. It can also be understood that dockfile is a script interpreted by the docker program. It consists of instructions one by one. Each instruction corresponds to a command under the Linux system. The docker program translates these dockerfile instructions into real Linux commands. Dockerfile has its own writing format and supported commands. The docker program resolves the dependencies between these commands, similar to makefile.
    Nginx 4153 2023-05-14 20:13:10
  • How does Nginx return the verification file directly?
    How does Nginx return the verification file directly?
    Directly return the verification file location=/XDFyle6tNA.txt{default_typetext/plain;return200'd6296a84657eb275c05c31b10924f6ea';} Many times WeChat and other programs require us to put a txt file into the project to verify the project ownership. We can directly use the above method Just modify nginx, there is no need to actually put the file on the server
    Nginx 1441 2023-05-14 20:01:10
  • How to install nginx server and load balancing configuration in CentOS6.5 environment
    How to install nginx server and load balancing configuration in CentOS6.5 environment
    1. Download pcre, which is a regular expression function library written in C language [root@localhostpcre-8.36]#cd/tmp/download/[root@localhostdownload]#wgethttp://nchc.dl.sourceforge.net/project /pcre/pcre/8.37/pcre-8.37.tar.gz[root@localhostdownload]#tarzxvfpcre-8.36.tar.gz2, download zlib library [root@localhostpcre-8.36]
    Nginx 802 2023-05-14 19:40:04
  • How to configure location in Nginx server
    How to configure location in Nginx server
    Grammar location[=|~|~*|^~]/uri/{...} Rule=: Indicates exact uri matching (interested students can take a look at the difference between url and uri)~: Indicates case-sensitive Regular matching~*: Indicates case-insensitive regular matching!~&&!~*: Indicates case-insensitive non-matching regular and case-insensitive non-matching regular /: Universal matching, any request will be matched to the location match The target location matching test only uses the request uri part, not the parameter part. (Reason: There are too many ways to write parameters and cannot be matched accurately) On the premise of multiple location configurations in the location matching sequence,
    Nginx 3571 2023-05-14 19:16:12
  • How to enable keepalive in nginx upstream
    How to enable keepalive in nginx upstream
    nginxupstream turns on keepaliveupstreamtomcat{serverops-coffee.cn:8080;keepalive1024;}server{location/{proxy_http_version1.1;proxy_set_headerConnection"";proxy_passhttp://tomcat;}}nginx will be used as a reverse proxy in most cases in the project , for example, nginx is followed by tomcat, nginx is followed by php, etc. At this time, we enable nginx and the backend
    Nginx 1474 2023-05-14 19:04:17
  • How to modify nginx to run on port 80 by default
    How to modify nginx to run on port 80 by default
    The modification method is very simple. Modify the nginx configuration file. For example, if the version is nginx-1.11.10, modify: nginx-1.11.10\conf\nginx.conf. Modify the value corresponding to http->server->listen, as shown in the figure: Just change it to another port number and it will be fine.
    Nginx 2439 2023-05-14 18:49:14

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