Search code examples
nginxapache2varnishckan

404 error accesing CKAN extension directories


I've built a CKAN extension from a pair already developed (ckanext-archiver and ckanext-report). The main idea is to modify the templates according to my needs. Everything is working fine except that I can only see those extensions through 8080 port. If I go to https://url/report/broken-links I get a 404 error.

I've already developed and used other extensions and everyone is showing in port 80 through nginx without any problem. The only record logged in /var/log/nginx/access.log is:

[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"

This is my /etc/nginx/sites-available/default config file:

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;
        }
}

Maybe I'm missing something? As far as I know, I don't need to specify nothing in the ckanext itself but this is my first time developing a CKAN extension from scratch so maybe I missed some important config.

Thank you so much in advance.


Solution

  • Well, I 'solved' this. We're using Varnish so I modified the regular expresion on /etc/varnish/default.vcl adding the path to /report/broken-links. So it was just a caching problem.

    I don't know if this is going to help anyone but it worked for me.