nginx 配置https(nginx怎么配置https访问)
本站教程收集整理的这篇文章主要介绍了nginx 配置http,本站教程本站觉得挺不错的,现在分享给大家,也给大家做个参考。
#配置1http跳转httpS配置server { listen 80; server_name xxx;#域名 rewrite ^(.*)$ http://$host$1 peRMANent; }#配置2http 443端口server { #listen 80;#去掉#号开启同时监听http和httpS,根据访问协议自动调整(去掉配置1) listen 443 ssl; server_name xxx;#域名 root /project;#项目目录 #注意这里没有 ssl on ssl_certificate /xxx.pem; # 指定证书的位置,绝对路径 ssl_certificate_key /xxx.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 / { index index index.htm index.php; try_files $uri $uri/ /index.php?$args; } LOCATIOn ~ .php { root /project; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; #fastcgi_param SCRIPT_FILename $document_root$fastcgi_script_name; #include fastcgi_params; #set $path_info ""; #set $real_script_name $fastcgi_script_name; #if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { # set $real_script_name $1; # set $path_info $2; #} #fastcgi_param SCRIPT_FILename $document_root$real_script_name; #fastcgi_param SCRIPt_name $real_script_name; #fastcgi_param PATH_INFO $path_info; }}
本站总结
如果觉得本站教程网站内容还不错,欢迎将本站教程推荐给好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。
《nginx 配置http(nginx怎么配置http访问)》来自互联网同行内容,若有侵权,请联系我们删除!
免责声明:本文内容来自用户上传并发布,站点仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。请核实广告和内容真实性,谨慎使用。