[Nginx] Error notes

This article records some errors and effective solutions for the failure to access the page of the corresponding port after starting Nginx.

How to query the error type that Nginx cannot start?

  • Check the error.log file in the logs folder under the Nginx directory. This file records the error type reports that occur when Nginx is started and run.
    error.log

1113: No mapping for the Unicode character exists in the target multi-byte code page

As shown below:
Insert picture description here

Solution

This error is due to the Chinese problem of the Nginx directory path. There are two solutions:

Method 1. Modify the path where Nginx is located to all English;
Method 2. Modify the content in the Nginx configuration file (./conf/nginx.conf) and add charset utf-8;, as follows:
server{
    
    
listen 80;
servername localhost;
root /var/www/html;
index index.html;
charset utf-8;
...

In addition, in this second configuration method, you also need to set the character set of the FTP and shell tools to UTF-8


10013: An attempt was made to access a socket in a way forbidden by its access permissions

As shown below:
Insert picture description here

Solution:

The starting port of Nginx has been used. There are two methods:

Method 1. Go to the configuration file (./conf/nginx.conf) to modify other unused startup ports:

Insert picture description here

Method 2. Terminate the application that uses the port and restart Nginx.exe
  • Open the shell window and enter the command: netstat -aon | findstr :80 (Note: The port you want to use for nginx, here is port 80 as an example)
    Insert picture description here
  • It can be seen that port 80 was closed by the application with serial number 4. At this time, enter the command: tasklist|findstr "12824" to view the application name
    Insert picture description here
  • Just terminate the program in the task manager.

Guess you like

Origin blog.csdn.net/weixin_40849588/article/details/90239971