美文网首页NAS
群晖 搭建私有为知笔记访问 nginx 错误

群晖 搭建私有为知笔记访问 nginx 错误

作者: Rinaloving | 来源:发表于2023-03-08 16:45 被阅读0次

    访问错误

    QQ图片20230309164508.png

    处理过程

    • 查看 docker 镜像
    docker ps
    
    • 查看 nginx
    ps -ef|grep nginx
    
    • 进入为知笔记 docker 镜像
    docker exec -it viticis-wizserver1 /bin/bash
    
    • 查看 nginx.conf 配置
    cat /etc/nginx/nginx.conf
    
    
    root@Pomelo:~# docker ps
    CONTAINER ID   IMAGE                                       COMMAND                  CREATED         STATUS         PORTS                                              NAMES
    29ac934eeb85   viticis/wizserver:latest                    "bash /wiz/app/entry…"   5 minutes ago   Up 5 minutes   0.0.0.0:5005->80/tcp                               viticis-wizserver1
    87c89759c8ce   johngong/calibre-web:latest                 "/init"                  3 days ago      Up 3 days      0.0.0.0:5003->8080/tcp, 0.0.0.0:5004->8083/tcp     johngong-calibre-web1
    c2439c1d3232   mysql:latest                                "docker-entrypoint.s…"   3 days ago      Up 3 days      0.0.0.0:3306->3306/tcp, 0.0.0.0:49153->33060/tcp   mysql1
    a23ae9535f4f   spikhalskiy/zerotier-containerized:latest   "/main.sh zerotier-o…"   4 days ago      Up 4 days                                                         spikhalskiy-zerotier-containerized1
    root@Pomelo:~# docker exec it viticis-wizserver1 /bash
    Error: No such container: it
    root@Pomelo:~# docker exec it viticis-wizserver1 /bin/bash
    Error: No such container: it
    root@Pomelo:~# docker exec -it viticis-wizserver1 /bin/bash
    [root@viticis-wizserver1 /]# ls
    Wiznote            bin   dev  home  lib64  mnt                                          opt   root  sbin  sys  usr  wiz
    anaconda-post.log  boot  etc  lib   media  mysql57-community-release-el7-10.noarch.rpm  proc  run   srv   tmp  var
    [root@viticis-wizserver1 /]# ps -ef|grep nginx
    root        82     1  0 08:27 ?        00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
    nginx       83    82  0 08:27 ?        00:00:00 nginx: worker process
    nginx       84    82  0 08:27 ?        00:00:00 nginx: worker process
    root      1610  1593  0 08:38 pts/1    00:00:00 grep --color=auto nginx
    [root@viticis-wizserver1 /]# cat /etc/nginx/nginx.conf
    #user  nobody;
    worker_processes  2;
    
    error_log  /wiz/storage/logs/nginx/error.log;
    #error_log  logs/error.log  notice;
    #error_log  logs/error.log  info;
    
    #pid        logs/nginx.pid;
    
    
    events {
        worker_connections  8192;
    }
    
    
    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;
        client_max_body_size 1G;
        client_body_buffer_size 1024k;
        client_header_buffer_size 2k;
    
    
        keepalive_timeout  65;
    
        gzip  on;
        gzip_disable "MSIE [1-6]\.(?!.*SV1)";
        gzip_min_length  1k;
        gzip_comp_level 6;
        gzip_types       text/plain application/javascript application/x-javascript text/css application/xml text/xml application/json image/svg+xml;
        gzip_vary on;
    
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        map $http_x_forwarded_proto $thescheme {
          default $scheme;
          https https;
        }
        proxy_set_header X-Forwarded-Proto $thescheme;
        server {        
            listen       80;
            server_name  localhost;
            root /wiz/app;
            
            location = /robots.txt {
                # rewrite /robots.txt  /pages/404.html  redirect;
                 deny all;
            }
    
            location = / {
                if ($is_args = ?){
                    rewrite / /api/;
                    proxy_pass http://127.0.0.1:5001;
                    break;
                }
                proxy_pass http://127.0.0.1:5001;
            }
       
            location / {
                proxy_pass http://127.0.0.1:5001;
            }
    
    
            location /api {
                proxy_pass http://127.0.0.1:5001/api;
            }
    
            location ~ ^/api/$ {
                proxy_pass http://127.0.0.1:5001;
            }
            
            location /go {
               proxy_pass http://127.0.0.1:5001;
            }
    
            location /wizmessage {
                proxy_pass http://127.0.0.1:5001/wizmessage;
            }
    
            location /wizks {
                proxy_pass http://127.0.0.1:5001/wizks;
            }
    
            location ^~ /wiz-resource {
                            #proxy_set_header Host ks.wiz.cn;
                            rewrite /wiz-resource/([^/]*)/([^/]*)/index_files/(.*)$ /ks/object/download/$1/$2?objType=resource&objId=$3 last;
                            proxy_pass http://127.0.0.1:4001;
            }
    
            location  /as {
                    proxy_pass http://127.0.0.1:5001;
            }
    
            location  ~* /ks/share/resources/.*/.*/jsonp {
                 proxy_pass http://127.0.0.1:5001;
            }
    
            location   /ks {
                 proxy_pass http://127.0.0.1:4001;
            }
            
            location ^~ /ws {
             proxy_pass http://127.0.0.1:5100;
             proxy_redirect off;
    
             proxy_http_version 1.1;
             proxy_set_header Upgrade $http_upgrade;
             proxy_set_header Connection "upgrade";
            }        
    
            location /wizsearch2 {
                proxy_pass http://127.0.0.1:3000;
            }
            
            location /search {
               proxy_pass http://127.0.0.1:3000;
            }
    
            location /manage_console {
              rewrite /manage_console /report last;
            }
    
            location ^~ /template {
                alias /wiz/app/webtemplate;
            }
    
            location ^~ /manual {
                root   /wiz/app/;
                index  index.html index.htm;
            }
            
            location ^~ /ui {
                proxy_pass http://127.0.0.1:5001/ui;
            }
    
            location ^~ /auth {
                rewrite /auth/(.*) /$1 permanent;
            }
               
            location ^~ /web {
                 proxy_pass http://127.0.0.1:5001/web;
            }
       
            location ^~ /report {
                proxy_pass http://127.0.0.1:5001/report;
            }
    
            location ^~ /wapp {
                proxy_pass http://127.0.0.1:5001/wapp;
            }
    
            location ^~ /xapp {
                add_header Service-Worker-Allowed "/xapp";
               root /wiz/app/wizserver/web/prod;
                index index.html;
                try_files $uri $uri/ /xapp/index.html;
            }
            location = /xapp {
               add_header Service-Worker-Allowed "/xapp";
               root /wiz/app/wizserver/web/prod;
               rewrite ^(.*)  $1/index.html break;
            }
    
            location ^~ /test {
              proxy_pass http://127.0.0.1:5001/test;
            }
    
            location ^~ /share {
                proxy_pass http://127.0.0.1:5001/share;
            }
    
            location ^~ /editor/ {
              proxy_redirect off;
              proxy_http_version 1.1;
              proxy_set_header Upgrade $http_upgrade;
              proxy_set_header Connection "upgrade";
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header X-Forwarded-Proto  $scheme;
              proxy_set_header Host $http_host;
              proxy_pass http://127.0.0.1:9000/;
            }
    
            location ^~ /convert/ {
                proxy_pass http://127.0.0.1:9100;
            }
            
            access_log  /wiz/storage/logs/nginx/access.log;
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
    }
    [root@viticis-wizserver1 /]# root@Pomelo:~# 
    
    • 还是不行

    最终解决

    • 访问为知笔记官方网站

    • 官方说只是没有完全起来而已,那就等等吧


      QQ截图20230309164904.png
    • 过一会再次刷新,成功


      QQ截图20230309165216.png

    相关文章

      网友评论

        本文标题:群晖 搭建私有为知笔记访问 nginx 错误

        本文链接:https://www.haomeiwen.com/subject/jmsoldtx.html