0514-86177077
9:00-17:00(工作日)
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開頭的屬性代表與證書配置有關,其他屬性請根據自己的需要進行配置。 server { listen 443 ssl; #SSL協議訪問端口號為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; #使用該協議進行配置。 ssl_prefer_server_ciphers on; location / { root /etc/nginx/hss; #站點目錄。 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; }
到此這篇關于nginx 代理80端口轉443端口的實現的文章就介紹到這了,更多相關nginx 代理80轉443內容請搜索腳本之家以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持腳本之家!
標簽:嘉興 運城 澳門 烏海 齊齊哈爾 衡陽 拉薩 亳州
上一篇:Nginx 根據URL帶的參數轉發的實現
下一篇:docker鏡像無法刪除 Error:No such image:xxxxxx解決
Copyright ? 1999-2012 誠信 合法 規范的巨人網絡通訊始建于2005年
蘇ICP備15040257號-8