工作生活

了解公网CA的https

2019-07-02  本文已影响0人  曾经的飞舞梦

80能用的,域名绑定的

server {

listen      80;

server_name   www.zj9j.cn  zj9j.cn;

return    301https://www.zj9j.cn$request_uri;

# rewrite .*  https://www.zj9j.cn$request_uri permanent;

}

server {

listen 443 ssl;

ssl on;

ssl_certificate  /etc/nginx/210.pem;

ssl_certificate_key /etc/nginx/120.key;

location / {

root /usr/share/nginx/html;

index index.html index.php;

}

}

基于IP的https端口跳转,80别限制了。

server {

listen      80;

server_name  39.108.140.0;

return 301https://39.108.140.0$request_uri;

location / {

root  /usr/local/nginx15/html;

index index.php index.html index.htm;

}

}

server {

listen      443 ssl;

ssl_certificate    /etc/nginx/210.pem;

ssl_certificate_key  /etc/nginx/120.key;

root  /usr/share/nginx/html;

index  index.html index.htm;

location ~ \.php$ {

root          /usr/local/nginx15/html;

fastcgi_pass  127.0.0.1:9000;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

include        fastcgi_params;

}

}

上一篇下一篇

猜你喜欢

热点阅读