欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

nginx 代理80端口轉(zhuǎn)443端口的實(shí)現(xiàn)

 更新時間:2020年09月06日 16:23:56   作者:詩水人間  
這篇文章主要介紹了nginx 代理80端口轉(zhuǎn)443端口的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

nginx.conf配置文件如下

user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid    /var/run/nginx.pid;


events {
  worker_connections 1024;
}


http {
  include    /etc/nginx/mime.types;
  default_type application/octet-stream;

  log_format main '$remote_addr - $remote_user [$time_local] "$request" '
           '$status $body_bytes_sent "$http_referer" '
           '"$http_user_agent" "$http_x_forwarded_for"';

  access_log /var/log/nginx/access.log main;

  sendfile    on;
  #tcp_nopush   on;

  keepalive_timeout 65;

  #gzip on;

  include /etc/nginx/conf.d/*.conf;
 
 # 以下屬性中以ssl開頭的屬性代表與證書配置有關(guān),其他屬性請根據(jù)自己的需要進(jìn)行配置。
 server {
 listen 443 ssl;  #SSL協(xié)議訪問端口號為443。此處如未添加ssl,可能會造成Nginx無法啟動。
 server_name localhost; #將localhost修改為您證書綁定的域名,例如:www.example.com。
 root html;
 index index.html index.htm;
 ssl_certificate /etc/nginx/huashengshu.top.pem;  #替換成您證書的文件名。
 ssl_certificate_key /etc/nginx/huashengshu.top.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;  #使用該協(xié)議進(jìn)行配置。
 ssl_prefer_server_ciphers on;  
 location / {
  root /etc/nginx/hss;  #站點(diǎn)目錄。
  index index.html index.htm;  
 }
 }
 

 server {
 listen 80;
 server_name huashengshu.top;
 rewrite ^(.*)$ https://${server_name}$1 permanent; 
 }

}

起作用的是

 server {
 listen 80;
 server_name huashengshu.top;
 rewrite ^(.*)$ https://${server_name}$1 permanent; 
 }

到此這篇關(guān)于nginx 代理80端口轉(zhuǎn)443端口的實(shí)現(xiàn)的文章就介紹到這了,更多相關(guān)nginx 代理80轉(zhuǎn)443內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論