访问CKAN扩展目录时出现404错误

时间:2018-10-01 08:51:50

标签: nginx apache2 varnish ckan

我已经从已经开发的一对(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)Gecko / 20100101 Firefox / 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扩展,因此也许我错过了一些重要的配置。

非常感谢您。

1 个答案:

答案 0 :(得分:0)

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

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