我有一个在Linode服务器上运行的Ruby on Rails应用,我正在尝试创建一个登台服务器来进行一些测试。我克隆了Linode并启动了服务器。我可以访问该网站,但是在Chrome中出现“不安全”错误,因此我想关闭ssl。因此,在/etc/nginx/sites-enabled/nginx.conf中,我注释了listen 443 ssl;
,也注释了引用ssl_certificate
和ssl_certificate_key
的行。在/etc/nginx/nginx.conf中,我注释了ssl_protocols
和ssl_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;
}
}