Thank you @ramble81@lemmy.zip 👍
Post saved !
Actually I don’t think the error lay in the regex.
because
location /fileA.txt {
return 404 'nothing here';
}
Does not works either…
.md is correct, it’s a test.
Thanks @elbucho@lemmy.world
I’ve tried
location ~* \/(fileA\.txt|fileB\.md)$ {
return 404 'nothing here';
}
but still not matching :'(
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…
Never mind, I understood my mistake…
This nginx built didn’t come with ngx_http_rewrite_module so return will not works.
I don’t see python on your image :)
The full working code:
server {
listen 443 ssl;
server_name _;
ssl_certificate /etc/nginx/ssl/catchall.crt;
ssl_certificate_key /etc/nginx/ssl/catchall.key;
error_page 404 /404_CatchAll.html;
# Everything is a 404
location / {
return 404;
}
location /404_CatchAll.html {root /var/www/html/;}
}
ok I’ve found something that ~works !
server {
listen 443 ssl;
server_name _;
ssl_certificate /etc/nginx/ssl/catchall.crt;
ssl_certificate_key /etc/nginx/ssl/catchall.key;
error_page 404 /404.html; #at /var/www/html/
location /404.html {internal;}
return 404;
}
so i get the default 404 html from nginx. but not the one that I specified error_page 404 /404.html;
any ideas ?
line 5 you mean ?
error_page 404 /404.html; #this one ?
Has I found nothing, I’ve write a piece of code in Python 🐍 ! and compile it for Windows…
Thank you @Vilian@lemmy.ca Seem great, I’ll keep it for later :)
But not for what I need now, as
Mutt is a small but very powerful text-based mail client for Unix operating systems
and it’s a “full” client, I need just the SMTP functionality.
yes, it’s been years that I’m using CMD
and as I’m planning get rid of windows there is no point for me to learn it.
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