samedi 22 mai 2021

This site can’t be reached puma, nginx rails deploy

I try remove nginx and reinstall it. But when I access from my IP vps, it always show

This site can’t be reached
refused to connect.

In my /etc/nginx/sites-enabled/default file in

##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html;

    server_name _;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
    }

}

nginx status

● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2021-05-23 01:23:00 UTC; 13min ago
       Docs: man:nginx(8)
    Process: 28124 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 28134 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 28136 (nginx)
      Tasks: 2 (limit: 2280)
     Memory: 2.6M
     CGroup: /system.slice/nginx.service
             ├─28136 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
             └─28137 nginx: worker process

I try to run sudo nginx -t, check log

bind() to [::]:80 failed (98: Address already in use)
still could not bind()

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

So please help me, why I access IP when nginx work it always is http, but when I remove and reinstall nginx, I see it always redirect to https




Aucun commentaire:

Enregistrer un commentaire