nginx.conf配置
進入linux /etc/nginx/ 打開nginx.conf 進行以下配置
http {include mime.types;default_type application/octet-stream;sendfile on;keepalive_timeout 65;server {#監聽443端口listen 443 ssl;#你的域名server_name huiblog.top;#ssl證書的pem文件路徑ssl_certificate "ssl證書的pem文件路徑";#ssl證書的key文件路徑ssl_certificate_key "ssl證書的key文件路徑";location / {# http://127.0.0.1:xxxxproxy_pass http://公網地址:項目端口號;}
}
server {listen 80;server_name huiblog.top;#將請求轉成httpsrewrite ^(.*)$ https://$host$1 permanent;
}
}
events {# 配置有新連接時,喚醒工作進程的方式accept_mutex on;# 配置每個工作進程是否可以同時接收連接multi_accept on;# 配置每個工作進程的最大連接數worker_connections 1024;
}