nginx configuration does not take effect

1. First confirm whether there are multiple nginx configuration files and whether the configuration is correct.

nginx -t

Insert image description here
You can see that my feedback here is that the configuration file of /etc/nginx/nginx.conf is configured normally.

If the configuration file path that appears here does not match your configuration, close the nginx service and start it by specifying the configuration file path.

#关闭nginx
nginx -s stop
#使用指定的配置文件启动nginx
nginx -c ${
    
    你的配置文件路径}
#例如
#nginx -c /etc/nginx/nginx.conf

2. If the above check is correct, confirm whether nginx contains the default configuration file.
Insert image description here
You can try to comment out the above two lines of configuration.
Then nginx -s reloadrestart the service and try again.

Guess you like

Origin blog.csdn.net/u014292402/article/details/127021096