https无法访问
https无法访问
- 登录后方可回帖
7 个回复 | 最后更新于 2017-06-09
server { listen 80; #listen [::]:80; server_name study.nichx.cn; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/study.nichx.cn; include enable-php.conf; # nginx configuration error_page 404 /404.php; # rewrite location / { try_files $uri $uri/ /index.php?$query_string; } # Git folder vulnerability location /.git { deny all; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } location ~ /\. { deny all; } access_log off; } server { listen 443; server_name study.nichx.cn; #填写绑定证书的域名 ssl on; ssl_certificate 1_study.nichx.cn_bundle.crt; ssl_certificate_key 2_study.nichx.cn.key; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照这个协议配置 ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;#按照这个套件配置 ssl_prefer_server_ciphers on; location / { root /home/wwwroot/study.nichx.cn; #站点目录 index index.html index.htm index.php; } }
这是/usr/local/nginx/conf/vhost/study.nichx.cn.conf
user www www; worker_processes auto; error_log /home/wwwlogs/nginx_error.log crit; pid /usr/local/nginx/logs/nginx.pid; #Specifies the value for maximum file descriptors that can be opened by this process. worker_rlimit_nofile 51200; events { use epoll; worker_connections 51200; multi_accept on; } http { include mime.types; default_type application/octet-stream; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 50m; sendfile on; tcp_nopush on; keepalive_timeout 60; tcp_nodelay on; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 256k; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.1; gzip_comp_level 2; gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss; gzip_vary on; gzip_proxied expired no-cache no-store private auth; gzip_disable "MSIE [1-6]\."; #limit_conn_zone $binary_remote_addr zone=perip:10m; ##If enable limit_conn_zone,add "limit_conn perip 10;" to server section. server_tokens off; access_log off; server { listen 80 default_server; #listen [::]:80 default_server ipv6only=on; server_name www.lnmp.org; index index.html index.htm index.php; root /home/wwwroot/default; #error_page 404 /404.html; include enable-php.conf; location /nginx_status { stub_status on; access_log off; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } location ~ /\. { deny all; } access_log /home/wwwlogs/access.log; } include vhost/*.conf; }
这是/usr/local/nginx/conf/nginx.conf
@lincanbin @后宫学长
回复#2 @nichx :
虽然不是很懂,但是看了下自己的配置,貌似你的是写多了一个server,你把443端口那段写上面一起就好了...
而且貌似证书位置也不对吧...
server { listen 80; listen 443 ssl http2; ssl_certificate /usr/local/nginx/conf/ssl/tucao.moe.crt; ssl_certificate_key /usr/local/nginx/conf/ssl/tucao.moe.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; ssl_prefer_server_ciphers on; ssl_session_timeout 10m; ssl_session_cache builtin:1000 shared:SSL:10m; ssl_buffer_size 1400; add_header Strict-Transport-Security max-age=15768000; ssl_stapling on; ssl_stapling_verify on; server_name tucao.moe i.tucao.moe m.tucao.moe; access_log /data/wwwlogs/tucao.moe_nginx.log combined; index index.html index.htm index.php; root /data/wwwroot/tucao.moe;
你参考下?
回复#2 @nichx :
Chrome测试打开没有问题。
回复#4 @后宫学长 改了一下rewrite就好了