windows 端 nginx怎么配置 虚拟机的fastdfs文件管理系统
2021-01-28 21:13
标签:class _for 访问 root 目录 gen keepaliv cal 安装 FastDFS的安装这里不演示 在windows 下访问192.168.133.131/group1/M00/+url 或者 img.xuecheng.com/group1/M00/+url windows 端 nginx怎么配置 虚拟机的fastdfs文件管理系统 标签:class _for 访问 root 目录 gen keepaliv cal 安装 原文地址:https://www.cnblogs.com/javaju/p/11877811.html
#图片服务
upstream img_server_pool{
server 192.168.133.131:80 weight=10;
}
#学成网图片服务
server {
listen 80;
server_name img.xuecheng.com;
#个人中心
location /group1/M00 {
proxy_pass http://img_server_pool;
}
}
cd /usr/local
tar -zxvf FastDFS-nginx-module_v1.16.tar.gz
cd FastDFS-nginx-module/src
cp mod_FastDFS.conf /etc/fdfs/
vi /etc/fdfs/mod_FastDFS.conf
base_path=/home/FastDFS
tracker_server=192.168.101.3:22122
tracker_server=192.168.101.4:22122
url_have_group_name=true #url 中包含 group 名称
store_path0=/home/fastdfs/fdfs_storage #指定文件存储路径
#如果有多个
cp /usr/lib64/libfdfsclient.so /usr/lib/
mkdir -p /var/temp/nginx/client
./configure --prefix=/usr/local/nginx --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_gzip_static_module --http-client-body-temp-path=/var/temp/nginx/client --http-proxy-temp-path=/var/temp/nginx/proxy --http-fastcgi-temp-path=/var/temp/nginx/fastcgi --http-uwsgi-temp-path=/var/temp/nginx/uwsgi --http-scgi-temp-path=/var/temp/nginx/scgi --add-module=/usr/local/fastdfs-nginx-module/src
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include 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 logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name 192.168.133.131;
#个人中心
location /group1/M00 {
root /home/fdfs_storage;
ngx_fastdfs_module;
}
}
/usr/local/nginx/sbin/nginx ‐c /usr/local/nginx/conf/nginx‐fdfs.conf
下一篇:利用U盘制作Win To Go
文章标题:windows 端 nginx怎么配置 虚拟机的fastdfs文件管理系统
文章链接:http://soscw.com/essay/48397.html