nginx - 浏览器无法停止指向https?

时间:2017-04-05 10:28:04

标签: ssl nginx archlinux

为什么nginx在没有说明的情况下继续指导?

我按照此guide将端口80重定向到3000:

server {
    listen 80;
    server_name example.co.uk www.example.co.uk;
    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://127.0.0.1:3000;
    }
}

工作得很好。然后我像以前一样尝试回滚,它只是继续重定向到https!

我甚至删除了nginx,但浏览器仍然重定向到https!为什么?做错了什么?我该如何解决?

有什么想法吗?

这是我尝试重定向之前的配置:

server {
    listen 80;
    server_name example.co.uk www.example.co.uk;
     return 301 https://$host$request_uri;
}

server {
      # listen       80;
      listen 433 ssl;
      server_name  example.co.uk www.example.co.uk;

      ssl on;
      ssl_certificate /etc/letsencrypt/live/example.co.uk/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/example.co.uk/privkey.pem;

      #charset koi8-r;

      #access_log  logs/host.access.log  main;

      location / {
          root   /usr/share/nginx/html;
          index  index.html index.htm;
     }

      location ~ /.well-known {
              allow all;
      }

在此之前,HTTPS工作正常。

编辑:

我已经重新安装了nginx并使用nginx -t进行了测试:

$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

0 个答案:

没有答案