Nginx modification configuration file does not take effect

1. Problem description

Because the data needs to be pushed to the database of other companies, but the server of the other company only opens a port for a certain server, the company's datax is deployed in another server, resulting in the failure to connect to the database normally. So I did nginx and performed two proxying, but the server of the other party suddenly had a problem, which caused the port of the database to be changed. When our company pushed the data, the data could not be pushed normally due to the change of the data source port. After modifying the nginx.conf file , reload the configuration file, but it cannot take effect normally.

2. Solutions

First of all, because the configuration file has been modified, it may be that the content and format of the configuration file are wrongly written, so
check it through nginx -t and find that there is no problem with the configuration file

nginx -t

insert image description here

Therefore, errors in writing configuration files can be ruled out.
Secondly, restart and start nginx, and then load the configuration file

nginx -s reload

insert image description here

I found that the modified configuration file was still not loaded.
Then, I checked again in the linux server (that is, the server where the datax program is deployed), and found that there is no problem with the content configuration in nginx.conf. I suddenly remembered that I had not modified this configuration. File, of course there is no problem.
Finally, I suddenly remembered that it might be because nginx started too many times, resulting in too many nginx processes, so the new configuration file could not be loaded all the time. At this time, I immediately checked the resource management of windows. The server found that there are several nginx processes
insert image description here

decisively kill all processes

taskkill /IM  nginx.exe  /F

Or you can right-click to close it, or you can
restart nginx and
click nginx.exe directly in the nginx installation directory
insert image description here

or use the command

nginx

To rest assured, reload the configuration file

nginx -s reload

Under normal circumstances, after restarting, the configuration file will be reloaded.
At this point, the problem has been completely resolved

Continually updated

Guess you like

Origin blog.csdn.net/qq_40520912/article/details/131089837