From f87024c32f969e9532f8276c033eed24e9013958 Mon Sep 17 00:00:00 2001 From: Me Date: Mon, 8 Aug 2022 04:02:53 +0200 Subject: [PATCH] further tested autoindex, and i got a .css stylesheet to load from a folder outside of /www, pretty neat :) --- default.config | 12 +++++++++++- stylesheet/style.css | 4 ++++ www/test/index1.html | 5 ++++- www/test/test_deeper/super_deep/something.html | 11 +++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 stylesheet/style.css create mode 100644 www/test/test_deeper/super_deep/something.html diff --git a/default.config b/default.config index 7277066..ab88bfd 100644 --- a/default.config +++ b/default.config @@ -14,7 +14,13 @@ server { root ./www/; location /test { - index something.html; + index index1.html; + } + + # /stylesheet/ alone doesn't work, i mean we don't have wildcards... + location /stylesheet/style.css { +# root ./www/../; + root ./; } location /test/something.html { @@ -28,6 +34,10 @@ server { autoindex on; } + location /test/test_deeper/super_deep { + autoindex on; + } + location /test/test_deeper/something.html { allow_methods DELETE; } diff --git a/stylesheet/style.css b/stylesheet/style.css new file mode 100644 index 0000000..2035bb4 --- /dev/null +++ b/stylesheet/style.css @@ -0,0 +1,4 @@ +h1 { + color: red; + text-align: center; +} diff --git a/www/test/index1.html b/www/test/index1.html index 1db5ee9..f976302 100644 --- a/www/test/index1.html +++ b/www/test/index1.html @@ -2,9 +2,12 @@ Webserv test index + + + -

Webserv Test Index

+

Webserv Test Index


(˚3˚)

diff --git a/www/test/test_deeper/super_deep/something.html b/www/test/test_deeper/super_deep/something.html new file mode 100644 index 0000000..94fb38c --- /dev/null +++ b/www/test/test_deeper/super_deep/something.html @@ -0,0 +1,11 @@ + + + + Webserv test deeper Something + + +

Webserv Test Super Deep Something

+
+

(˚3˚)

+ +