日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

nginx + openssl 搭建需要身份验证的文件下载服务器

發(fā)布時間:2025/3/21 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 nginx + openssl 搭建需要身份验证的文件下载服务器 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

安裝nginx+openssl
編輯 /etc/nginx/nginx

#user www-data; user root; worker_processes auto; pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf;events {worker_connections 768;# multi_accept on; }http {sendfile on;tcp_nopush on;tcp_nodelay on;keepalive_timeout 65;types_hash_max_size 2048;include /etc/nginx/mime.types;default_type application/octet-stream;ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLEssl_prefer_server_ciphers on;access_log /var/log/nginx/access.log;error_log /var/log/nginx/error.log;gzip on;gzip_disable "msie6";include /etc/nginx/conf.d/*.conf;include /etc/nginx/sites-enabled/*;server {autoindex on;autoindex_exact_size on;autoindex_localtime on;listen 25000 default_server;listen [::]:25000 default_server;server_name _;root /root/server/;location / {auth_basic "authentication";auth_basic_user_file /etc/nginx/passwd;}}}

生成 /etc/nginx/passwd
openssl passwd 你的密碼 >> /etc/nginx/passwd
然后編輯/etc/nginx/passwd,在密文前面加上用戶名和冒號

service nginx reload 重啟即可

總結(jié)

以上是生活随笔為你收集整理的nginx + openssl 搭建需要身份验证的文件下载服务器的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。