BlackRa1n
(KIloka)
October 18, 2021, 2:11pm
1
Hello All,
I have a problem to make NGINX rules work on caddy
Can you help me thanks
1. Caddy version (caddy version
):
V.2
2. How I run Caddy:
Unbuntu Machine, PHP CGI
a. System environment:
Ubuntu
b. Command:
d. My complete Caddyfile or JSON config:
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ /(knob|door|key) {
deny all;
return 404;
}
location ~* /(knob|door|key|gem)/(.+)\.(jpg|jpeg|png|gif|css|js|svg|flv|mp3|jfif|wav|mp4|ogg|pdf|webm|json|webp|bmp)$ {
allow all;
}
location ~ /(knob|door|key|gem)/(.+)\.[^\.]+$ {
deny all;
}
3. The problem I’m having:
Converting htaccess from NGINX to caddy
BlackRa1n:
1. Caddy version (caddy version
):
V.2
Which version exactly ? It often matters, you may be using an old version with known bugs, or less features. Run the caddy version
command to find out.
BlackRa1n:
d. My complete Caddyfile or JSON config:
That’s your Nginx config in that section.
What are you trying to do exactly? What have you tried so far? What do you have in your Caddyfile right now?
Please at least try to figure it out yourself, it’s the best way to learn. Make sure to read through the docs.
1 Like
BlackRa1n
(KIloka)
October 18, 2021, 3:02pm
3
Hello Sir,
Thanks for you response
Caddy v2.4.5
and i already tried this (it’s works) but others rules i don’t know how to
# TEST 1
@denied_folders path_regexp /(\.github|knob|door|key|backup.*|test.*)/.*$
respond @denied_folders "File Not Found" 404
but others i can’t success to make it
sorry i’m french
BlackRa1n
(KIloka)
October 18, 2021, 3:03pm
4
and my caddy file is too long, i just have a problem because i tried to make rules in caddy format but i can’t
others conf works very well and caddy is the best honestly
matt
(Matt Holt)
October 18, 2021, 3:56pm
5
Are the docs inaccessible due to their language? I know they are only in English; translating to French is not something that has been on our radar. Can you use Google Translate to help?
As a hint, here are the docs for try_files: try_files (Caddyfile directive) — Caddy Documentation
Please give it a try, I hope Google Translate can help. Then let us know what you’ve tried.
BlackRa1n
(KIloka)
October 18, 2021, 3:59pm
6
Try_files is ok
my only problem is this
location ~* /(knob|door|key|gem)/(.+)\.(jpg|jpeg|png|gif|css|js|svg|flv|mp3|jfif|wav|mp4|ogg|pdf|webm|json|webp|bmp)$ {
allow all;
}
location ~ /(knob|door|key|gem)/(.+)\.[^\.]+$ {
deny all;
}
system
(system)
Closed
November 17, 2021, 2:12pm
7
This topic was automatically closed after 30 days. New replies are no longer allowed.