Datatables - Cloudfront is causing error 403 with server-side

Datatables - Cloudfront is causing error 403 with server-side

yveteeyvetee Posts: 29Questions: 7Answers: 0

Hello,

i am using datatables with server-side for my personal app. It is working fine for 2years but now i am testing it with a tunnel so i can use it from everywhere.

My error is 403 and after trying to find the reason i found that the tunnel app is using cloudfront which it is giving the error.

Any idea how to fix it?

function getExpenses() {
    if ($.fn.DataTable.isDataTable('#ExpensesTable')) {
        $('#ExpensesTable').DataTable().destroy();
    }
    $('#ExpensesTable').DataTable({
        ajax: 'api/expenses.php?action=getExpenses',
        dom: '<"DataTableInfo"i><"DataTableFilter"f>rt',
        scrollY: 520,
        processing: true,
        serverSide: true,
        ordering: false,
        scroller: true,
        oLanguage: {
            "sSearch": "<strong>Search Expenses:</strong>" //search
        },
        initComplete: function(settings, json) {
            $('.dataTables_scrollBody').css({
                'overflow': 'hidden',
                'overflow-y': 'auto'
            });
            //var api = new $.fn.dataTable.Api( settings );
            //api.scroller.toPosition( json.recordsFiltered );
        },
        columnDefs: [
            {width: "10px", targets: 0},  
            {width: "8%",   targets: 1}, 
            {width: "14%", targets: 2},
            {width: "0%",   targets: 3},
            {width: "0%", targets: 4},
            {width: "10%", targets: 5},
            {width: "10%", targets: 6},
            {width: "11%", targets: 7},
            {width: "10%",  targets: 8},
            {width: "25%", targets: 9},
            {width: "12%", targets: 10}, 
            {className: "text-right", "targets": [3, 5]},
            {className: "text-center", "targets": [0, 1, 6, 7, 8, 10]}
        ],
    });
}

Answers

  • kthorngrenkthorngren Posts: 20,269Questions: 26Answers: 4,765
    edited February 2022

    i found that the tunnel app is using cloudfront which it is giving the error.

    That will be a cloudfront issue. Maybe this SO thread will help.

    Kevin

Sign In or Register to comment.