nginx Proxy port 80 does not work solution _nginx_ Scripting Home

Solution where nginx proxy port 80 does not take effect

Updated: Feb 25, 2024 16:23:38 Author: Mingyue a pot of wine
If your Nginx agent is configured with port 80, and still displays the default Nginx page when visiting, there may be many reasons for this, this article gives you an introduction to the causes and solutions, with a certain reference value, the need of friends can refer to the next

If your Nginx agent is configured with port 80 and still displays the default Nginx page when accessed, it may be due to the following reasons:

  1. Default site configuration: By default, Nginx creates a default site profile during installation, which listens on port 80 and displays a default welcome page. If your proxy configuration does not take effect, it may be because the default site profile takes precedence over your proxy profile. You can try removing or disabling the default site profile to ensure that the proxy configuration takes effect.

    The default site configuration file path may be/etc/nginx/sites - enabled/default or/etc/nginx/conf. D/default. Conf, specific path depends on your operating system and way of nginx configuration. You can use the following command to find the default site profile:

ls /etc/nginx/sites-enabled/ ls /etc/nginx/conf.d/ If the default site configuration file is found, it can be backed up and removed (or disabled) using the following command:  ````shell sudo mv /etc/nginx/sites-enabled/default /etc/nginx/sites-enabled/default.backup sudo mv / etc/nginx/conf. D/default conf/etc/nginx/conf. D/default. Conf. Backup ` ` ` then reload nginx configuration file: ````shell sudo systemctl reload nginx This ensures that the proxy configuration takes effect and overrides the default site configuration.
  • Proxy path configuration:
    If your proxy configuration takes effect, but other paths to access the proxy (e.g/aaaA 404 error may be caused by an incorrect proxy path configuration. Please check your proxy profile to make sure that inlocationThe path and target server of the proxy are correctly configured in the block. For example:
server { listen 80; server_name example.com; location / { proxy_pass http://backend_server; In the example above, the 'proxy_pass' directive brokers the request to a backend server named 'backend_server'. Make sure your proxy is configured correctly and that you specify the correct path and target server in the 'location' block. If your proxy path is' /aaa ', then your configuration should look something like: ````nginx server {listen 80; server_name example.com; location /aaa { proxy_pass http://backend_server; Make sure to reload the Nginx configuration file for the changes to take effect.
  1. Nginx version issue: You mentioned that you are using Nginx version 1.23.0. Make sure the version you are using supports the features you need and has no known issues. Sometimes, a particular version of Nginx may have a bug or behavior change that may cause the agent to be configured improperly. You can consult Nginx's official documentation, release notes, or community forums to learn about issues and workaround related to the particular version you're using.

Hopefully, the above solution will help you solve the problem with Nginx proxy port 80. If the problem persists, please provide more details, such as the contents of the Nginx configuration file and the relevant entry of the error log, for further analysis and to help you resolve the problem.

To this article about the nginx agent 80 port does not take effect of the solution is introduced to this article, more related to nginx 80 port does not take effect content please search the script home previous articles or continue to browse the following related articles hope that you will support the script home in the future!

Related article

Latest comments