The problem was solved, after so much debugging the problem was an HTML tag <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> , nothing to do with symfony or nginx