开发者社区> 问答> 正文

阿里云+nginx+ssl+https,可用http和ip成功访问但是用https和域名无法访问

在服务器上可以通过ping和wget连接网页 fae6d5f94cd2ecad1b0e146ca697c72.png 但是在自己的window浏览器中却不能访问 07f9a27e8744ef672581fe35f227d31.png 66c0f6fd3cb455006c9fb9c1f41d453.png

求大神解答! 相关信息如下

域名解析正常 75e5b3bdb32934b7c474f14fde20724.png

服务器的相关端口有打开 31683984db3de9548f578fbc9511334.png

nginx的相关信息如下 3b951e00334865e758b17d7968e660b.png

nginx运行时 443和80端口也有监听 fcdcde64595bfd4cee9693d6fd10602.png

nginx的配置文件nginx.conf内容如下:

worker_processes auto;
pid /run/nginx.pid;

events {
	worker_connections 768;
}

http {

	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_protocols TLSv1 TLSv1.1 TLSv1.2; 
	ssl_prefer_server_ciphers on;


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


	gzip on;
	gzip_disable "msie6";



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

	server {
		listen 80;
		server_name 47.98.49.83;
		charset utf-8,gbk;
		
		location / {
			uwsgi_pass 47.98.49.83:8000;
			include /etc/nginx/uwsgi_params;
		}

		location /static {
			alias /root/project/faceHealth/collected_static/;
		}

		error_page 404 /404.html;
			location = /40x.html {
		}

		error_page 500 502 503 504 /50x.html;
			location = /50x.html {
		}

	}

	server {
		listen 443 ssl;   
		server_name facehealthcloud.club www.facehealthcloud.club;  
		ssl on;
		charset utf-8,gbk;
		root html;
		index index.html index.htm;
		
		ssl_certificate cert/cert.pem;  
		ssl_certificate_key cert/cert.key;   
		ssl_session_timeout 5m;
		ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;  
		ssl_protocols TLSv1 TLSv1.1 TLSv1.2;   
		ssl_prefer_server_ciphers on;  

		location / {
			uwsgi_pass 47.98.49.83:8000;
			include /etc/nginx/uwsgi_params;
		}

		location /static {
			alias /root/project/faceHealth/collected_static/;
		}

		error_page 404 /404.html;
			location = /40x.html {
		}

		error_page 500 502 503 504 /50x.html;
			location = /50x.html {
		}
	}               
}



展开
收起
kerder·sir 2020-02-09 16:28:02 1700 0
1 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
CDN助力企业网站进入HTTPS时代 立即下载
《Nginx 代理系统常用手册》 立即下载
域名升级时代来临 立即下载