nginx配置https|nginx强制跳转https

nginx配置https|nginx强制跳转https

#新增内容
server {
        listen 80;
        server_name aa.nice513.com;
        return 301 https://$server_name$request_uri;
}
#新增内容

server {
        listen 443 default ssl;  #开启443端口
        ssl on;                     #开启ssl
        #配置crt路径 绝对路径
        ssl_certificate   /etc/nginx/aa.nice513.com/1_aa.nice513.com_bundle.crt;  
        #配置key路径 绝对路径
        ssl_certificate_key  /etc/nginx/aa.nice513.com/2_aa.nice513.com.key;

        server_name  aa.nice513.com;
        root   "/aa.nice513.com";


        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }

        location / {
            index  index.html index.htm index.php;
            #try_files $uri $uri/ /index.php?$query_string;
        }
}

你说你没有https证书?? 

来来来 我告诉你那里有 https一年证书免费申请下载!!!!!

nginx配置https|nginx强制跳转https



喜欢(0)

评论 抢沙发

表情