停止NGINX开发人员站点重定向到SSL

时间:2018-08-20 14:05:38

标签: ssl nginx

我有一个在Linode服务器上运行的Ruby on Rails应用,我正在尝试创建一个登台服务器来进行一些测试。我克隆了Linode并启动了服务器。我可以访问该网站,但是在Chrome中出现“不安全”错误,因此我想关闭ssl。因此,在/etc/nginx/sites-enabled/nginx.conf中,我注释了listen 443 ssl;,也注释了引用ssl_certificatessl_certificate_key的行。在/etc/nginx/nginx.conf中,我注释了ssl_protocolsssl_prefer_server_ciphers。完成此操作后,我重新启动了nginx。

当我访问IP地址时,地址部分重定向到SSL,并收到一条消息,提示This site can’t be reached。为什么站点仍重定向到ssl?我在某处缺少配置吗?

编辑

这是nginx.conf:

user www-data;
worker_processes auto;
pid /run/nginx.pid;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        client_max_body_size 50M;
        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        # SSL Settings
        ##

        #ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
        #ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";
    # include /etc/nginx/passenger.conf;
        passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
        passenger_ruby /home/deployer/.rbenv/shims/ruby;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}

...以及启用了网站/默认的网站

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

        #listen 443 ssl;

        passenger_enabled on;
        rails_env production;
        root /home/deployer/myapp/current/public;
        #index index.html index.htm;

        # Make site accessible from http://localhost/
        server_name blah.org;

        #ssl_certificate /etc/nginx/ssl/blag.combined.crt;
        #ssl_certificate_key /etc/nginx/ssl/blah.key;

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
                root html;
                #client_max_body_size 50M;

        }
}

0 个答案:

没有答案