【问题标题】:404 error accesing CKAN extension directories访问 CKAN 扩展目录时出现 404 错误
【发布时间】:2018-10-02 15:14:09
【问题描述】:

我已经从已经开发的一对(ckanext-archiver 和 ckanext-report)构建了一个 CKAN 扩展。主要思想是根据我的需要修改模板。一切正常,除了我只能通过 8080 端口看到这些扩展。如果我转到 https://url/report/broken-links 我会收到 404 错误。

我已经开发并使用了其他扩展,每个人都通过 nginx 显示在端口 80 没有任何问题。登录/var/log/nginx/access.log的唯一记录是:

[01/Oct/2018:08:20:19 +0000] "GET /report/broken-links HTTP/1.1" 404 70770 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv: 62.0) 壁虎/20100101 火狐/62.0"

这是我的/etc/nginx/sites-available/default 配置文件:

server {
        listen 443 ssl;

        server_name foo;
        ssl_certificate /etc/ssl/crt/foo.crt;
        ssl_certificate_key /etc/ssl/crt/foo.key;
        proxy_read_timeout 150;

        server_tokens off;
        more_clear_headers "Server";

        ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers         RSA:!EXP:!NULL:+HIGH:+MEDIUM:-LOW:-SSLv2:!RC4;

        client_max_body_size 10M;

       error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 420 422 423 424 426 428 429 431 444 449 450 451 500 501 502 503 504 505 506 507 508 509 510 511 /5xx.html;

        location / {
            proxy_pass http://127.0.0.1:80;
            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 https;
            proxy_set_header X-Forwarded-Port 443;
            proxy_set_header Host $host;
            proxy_read_timeout 300;
        }
        location /5xx.html {
            root /var/www/html/error;
            internal;
        }
}

也许我错过了什么?据我所知,我不需要在 ckanext 本身中指定任何内容,但这是我第一次从头开始开发 CKAN 扩展,所以也许我错过了一些重要的配置。

非常感谢您。

【问题讨论】:

    标签: nginx apache2 varnish ckan


    【解决方案1】:

    好吧,我“解决了”这个问题。我们正在使用 Varnish,所以我修改了 /etc/varnish/default.vcl 的正则表达式,将路径添加到 /report/broken-links。所以这只是一个缓存问题。

    我不知道这是否会帮助任何人,但它对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多