~~Never mind, I understood my mistake... This nginx built didn't come with ngx_http_rewrite_module so return will not works.~~
Web Development
Welcome to the web development community! This is a place to post, discuss, get help about, etc. anything related to web development
What is web development?
Web development is the process of creating websites or web applications
Rules/Guidelines
- Follow the programming.dev site rules
- Keep content related to web development
- If what you're posting relates to one of the related communities, crosspost it into there to help them grow
- If youre posting an article older than two years put the year it was made in brackets after the title
Related Communities
- !html@programming.dev
- !css@programming.dev
- !uiux@programming.dev
- !a11y@programming.dev
- !react@programming.dev
- !vuejs@programming.dev
- !webassembly@programming.dev
- !javascript@programming.dev
- !typescript@programming.dev
- !nodejs@programming.dev
- !astro@programming.dev
- !angular@programming.dev
- !tauri@programming.dev
- !sveltejs@programming.dev
- !pwa@programming.dev
Wormhole
Some webdev blogs
Not sure what to post in here? Want some web development related things to read?
Heres a couple blogs that have web development related content
- https://frontendfoc.us/ - [RSS]
- https://wesbos.com/blog
- https://davidwalsh.name/ - [RSS]
- https://www.nngroup.com/articles/
- https://sia.codes/posts/ - [RSS]
- https://www.smashingmagazine.com/ - [RSS]
- https://www.bennadel.com/ - [RSS]
- https://web.dev/ - [RSS]
Apparently ngx_http_rewrite_module "module" is installedby default with nginx... damn thay should use diffrent terms for what could be install or not at compile time..
You aren't escaping your periods. Try like this:
location ~* \/(fileA|fileB)\.txt$ {
return 404 'nothing here';
}
Thanks @elbucho@lemmy.world
I've tried
location ~* \/(fileA\.txt|fileB\.md)$ {
return 404 'nothing here';
}
but still not matching :'(
.md or .txt?
.md is correct, it's a test.
You might have another location block before it that catches the route.
Finally it works as it should I update my old nginx version to newest freenginx and read Thoroughly the location documentation and this post thanks to @ramble81@lemmy.zip
Actually I don't think the error lay in the regex.
because
location /fileA.txt {
return 404 'nothing here';
}
Does not works either...