further tested autoindex, and i got a .css stylesheet to load from a folder outside of /www, pretty neat :)

This commit is contained in:
Me
2022-08-08 04:02:53 +02:00
parent 9ee7205b95
commit f87024c32f
4 changed files with 30 additions and 2 deletions

View File

@@ -14,7 +14,13 @@ server {
root ./www/; root ./www/;
location /test { 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 { location /test/something.html {
@@ -28,6 +34,10 @@ server {
autoindex on; autoindex on;
} }
location /test/test_deeper/super_deep {
autoindex on;
}
location /test/test_deeper/something.html { location /test/test_deeper/something.html {
allow_methods DELETE; allow_methods DELETE;
} }

4
stylesheet/style.css Normal file
View File

@@ -0,0 +1,4 @@
h1 {
color: red;
text-align: center;
}

View File

@@ -2,9 +2,12 @@
<html> <html>
<head> <head>
<title>Webserv test index</title> <title>Webserv test index</title>
<!-- <link rel="stylesheet" href="stylesheet/style.css"> -->
<link rel="stylesheet" href="/stylesheet/style.css">
</head> </head>
<body> <body>
<h1 style="text-align:center">Webserv Test Index</h1> <h1>Webserv Test Index</h1>
<hr> <hr>
<p style="text-align:center">(˚3˚)</p> <p style="text-align:center">(˚3˚)</p>
</body> </body>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Webserv test deeper Something</title>
</head>
<body>
<h1 style="text-align:center">Webserv Test Super Deep Something</h1>
<hr>
<p style="text-align:center">(˚3˚)</p>
</body>
</html>