首页 > 解决方案 > nginx 服务器:无法连接 128.0.0.1:8888

问题描述

我的错误

无法连接 Firefox 无法与位于 127.0.0.1:8888 的服务器建立连接。

ls -l /etc/fdfs/ 总计 84

-rw-r--r-- 1 root root  1469 六月 14 10:10 client.conf
-rw-r--r-- 1 root root  1461 六月 14 09:44 client.conf.sample
-rw-r--r-- 1 root root   955 六月 14 14:31 http.conf
-rw-r--r-- 1 root root 31172 六月 14 14:31 mime.types
-rw-r--r-- 1 root root  3725 六月 14 14:22 mod_fastdfs.conf
-rw-r--r-- 1 root root  7938 六月 14 10:02 storage.conf
-rw-r--r-- 1 root root  7927 六月 14 09:44 storage.conf.sample
-rw-r--r-- 1 root root   105 六月 14 09:44 storage_ids.conf.sample
-rw-r--r-- 1 root root  7394 六月 14 10:25 tracker.conf
-rw-r--r-- 1 root root  7389 六月 14 09:44 tracker.conf.sample

我的服务器 ps aux |grep nginx

root      29867  0.0  0.0  38152   616 ?        Ss   14:41   0:00 nginx: master process ./nginx
coco      30010  0.0  0.0  21532  1084 pts/2    S+   14:55   0:00 grep --color=auto nginx

/usr/local/nginx/conf

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       8888;
            server_name  localhost;
            location ~/group[0-9]/ {
                ngx_fastdfs_module;
            }
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
            root   html;
            }
    }

我正在尝试查看我刚刚上传的图片。像这样的命令

fdfs_upload_file /etc/fdfs/client.conf /home/coco/Pictures/coco.jpg 
group1/M00/00/00/wKgTgF7lxkyAGO0-AAAiaSlNP3Q922.jpg

标签: djangonginx

解决方案


我仔细检查了我的 tracker.conf,发现我忘记了更改 bath_path 应该是

base_path=/home/coco/fastdfs/tracker/

像这样更改我的服务器进程后

root      31082  0.0  0.2 141252  6804 ?        Ss   15:28   0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data  31546  0.0  0.2 143924  6464 ?        S    15:36   0:00 nginx: worker process
www-data  31547  0.0  0.2 143924  6464 ?        S    15:36   0:00 nginx: worker process
root      31678  0.0  0.0  38156   616 ?        Ss   15:45   0:00 nginx: master process ./nginx
nobody    31679  0.0  0.1  43096  4184 ?        S    15:45   0:00 nginx: worker process
root      31712  0.0  0.0  21532  1056 pts/3    S+   15:47   0:00 grep --color=auto nginx

在此处输入图像描述

这是工作


推荐阅读