zl程序教程

您现在的位置是:首页 >  移动开发

当前栏目

nginx配置ssl证书实现https访问详解程序员

配置SSLNginxHTTPS程序员 实现 详解 访问
2023-06-13 09:19:58 时间
server_name www.abc.lynch.com abc.lynch.com; error_log /usr/share/nginx/html/test/pay_local.error; client_max_body_size 60M; client_body_buffer_size 512k; location / { root /usr/share/nginx/html/kshop; index index.html; autoindex on; # rewrite ^(.*) https://$server_name$1 permanent; server { listen 443 ssl; server_name www.abc.lynch.com abc.lynch.com; error_log /usr/share/nginx/html/test/pay_local.error; client_max_body_size 60M; client_body_buffer_size 512k; location / { root /usr/share/nginx/html/kshop; index index.html; autoindex on; ssl_certificate /etc/nginx/conf.d/fullchain.pem; #证书位置 ssl_certificate_key /etc/nginx/conf.d/privkey.pem; #私钥位置 }

 

server { 

 listen 443 ssl; 

 server_name www.erpshopmobilexmjservertest.xinyartech.com erpshopmobilexmjservertest.xinyartech.com; 

 error_log /usr/share/nginx/html/test/pay_local.error; 

 client_max_body_size 60M; 

 client_body_buffer_size 512k; 

 location / { 

 proxy_pass http://172.16.92.254:8062; 

 ssl_certificate /etc/nginx/conf.d/fullchain.pem; 

 ssl_certificate_key /etc/nginx/conf.d/privkey.pem; 

}

 

2、启动nginx,映射443端口

docker run --restart=always --name nginx_erp_test -d -p 80:80 -p 443:443 -v /www/html/attachment:/www/html/attachment -v /data/nginx/html:/usr/share/nginx/html -v /data/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v /data/nginx/logs:/var/log/nginx -v /data/nginx/conf.d:/etc/nginx/conf.d nginx

 

原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/2135.html

服务器部署程序员系统优化网站设置运维