I am currently using nginx reverse proxy for my website, which has subdomains and used let’s encrypt as the ssl authority. My website works fine in firefox and safari. However in chrome, My website doesnt seem to load the external scripts as it constantly fails.I even tried to see if the requests are reaching my proxy server,which it doesnt. Hence, it doesnt load any of my external script. It gives a net:ERR_FAILED. I have added the screenshots of the console log. However, self signed certificates load the website.
Here is how I call the external script:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
Here is the code of my nginx server:
upstream platform {
server 127.0.0.1:8081;
#server 192.0.0.1 backup;
}
server {
index index.html index.htm index.nginx-debian.html;
server_name test.example.com; # managed by Certbot
add_header Access-Control-Max-Age 3600;
add_header Access-Control-Expose-Headers Content-Length;
location / {
# First attempt to serve request as file, then
if ($request_method = OPTIONS) {
add_header Access-Control-Allow-Origin *;
return 204;
}
proxy_set_header Host test.example.com;
sub_filter "127.0.0.1:8081" "test.example.com";
proxy_pass http://test;
include /etc/nginx/proxy_params;
}
location /.well-known/ {
root /var/www/html/;
}
listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_certificate /etc/ssl/certificate.crt;
ssl_certificate_key /etc/ssl/private.key;
}
server {
if ($host = test.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 ;
listen [::]:80 ;
server_name test.example.com;
return 404; # managed by Certbot
}
This works when it is a self signed certificate. Could it be a problem with my ssl certificate?