Priyash
Priyash
CDCloudflare Developers
Created by Priyash on 12/24/2024 in #general-help
R2 Static web hosting rules
hello, I have a SSG site uploaded to public r2 bucket pointing v2.priyashpatil.com. After a while I figured a way to get it working but it requires two rules. Here's the folder SSG structure looks like:
| __ index.html
| __ contact
| __ __ index.html
| __ index.html
| __ contact
| __ __ index.html
and i have two rules: First:
(http.host eq "v2.priyashpatil.com" and not ends_with(http.request.uri.path, "/") and not http.request.uri.path contains "." and not http.request.uri.path contains "__manifest")
(http.host eq "v2.priyashpatil.com" and not ends_with(http.request.uri.path, "/") and not http.request.uri.path contains "." and not http.request.uri.path contains "__manifest")
and dynamic rewrite:
concat(http.request.uri.path, "/index.html")
concat(http.request.uri.path, "/index.html")
Second:
(http.host eq "v2.priyashpatil.com" and ends_with(http.request.uri.path, "/") and not http.request.uri.path contains "." and not http.request.uri.path contains "__manifest")
(http.host eq "v2.priyashpatil.com" and ends_with(http.request.uri.path, "/") and not http.request.uri.path contains "." and not http.request.uri.path contains "__manifest")
and dynamic rewrite:
concat(http.request.uri.path, "index.html")
concat(http.request.uri.path, "index.html")
Notice both rules are almost identical except i had to do this because "/". I tried path matching */* but it doesn't capture the url without tailing "/". So the urls v2.priyashpatil.com and v2.priyashpatil.com/contact/ would work but url v2.priyashpatil.com/contact doesnt work. So I had to do this two rules trick here. Now is there any way to make it into one rule?
3 replies
CDCloudflare Developers
Created by Priyash on 8/25/2024 in #general-help
Authenticated Origin Pull Not working
I followed this article: https://developers.cloudflare.com/ssl/origin-configuration/authenticated-origin-pull/set-up/zone-level/
ssl_certificate /etc/ssl/nginx/cert.pem;
ssl_certificate_key /etc/nginx/clf/key.pem;
ssl_verify_client on;
ssl_client_certificate /etc/nginx/clf/cloudflare.crt;
ssl_certificate /etc/ssl/nginx/cert.pem;
ssl_certificate_key /etc/nginx/clf/key.pem;
ssl_verify_client on;
ssl_client_certificate /etc/nginx/clf/cloudflare.crt;
Spend entire day to figure this out only getting
400 Bad Request
No required SSL certificate was sent
nginx
400 Bad Request
No required SSL certificate was sent
nginx
56 replies