-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
455 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,3 +43,4 @@ test | |
*.DS_Store | ||
www/tmp/* | ||
webserv_correc.pdf | ||
cgis/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
server { | ||
listen 4343 | ||
server_name localhost test.com | ||
root www | ||
index index.html | ||
error_page 404 /404.html | ||
error_page 405 /405.html | ||
max_client_body_size 400 | ||
listen 4343; | ||
root www/site0; | ||
index index.html; | ||
location / { | ||
allow GET POST DELETE | ||
index index.html | ||
allow GET; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,44 @@ | ||
server { | ||
listen 4343; | ||
server_name localhost test.com; | ||
root www/; | ||
cgi .py /usr/bin/python2.7; | ||
cgi .php ./www/cgi-bin/php-cgi; | ||
cgi .php ./cgis/php-cgi; | ||
root www; | ||
index index.html; | ||
error_page 405 /405.html; | ||
max_client_body_size 4096; | ||
|
||
max_client_body_size 10; | ||
location / { | ||
allow GET HEAD POST DELETE; | ||
# index page.html; | ||
allow GET POST DELETE; | ||
root first; | ||
index page.html; | ||
} | ||
location /first/ { | ||
allow GET HEAD; | ||
location /one/ { | ||
allow GET DELETE POST; | ||
autoindex 1; | ||
# index page.html; | ||
} | ||
location /demo/ { | ||
allow GET HEAD POST DELETE; | ||
index index.html; | ||
root /site1; | ||
} | ||
# location /first/second/ { | ||
# allow GET; | ||
# # index page.html; | ||
# } | ||
location /blabla/ { | ||
location /two { | ||
allow GET; | ||
# index page.html; | ||
root site2/; | ||
index hello.html; | ||
} | ||
location /first_redirect/ { | ||
location /three { | ||
allow GET POST DELETE; | ||
root site3/; | ||
index index.html; | ||
} | ||
} | ||
|
||
server { | ||
listen 6969; | ||
server_name localhost data.com; | ||
root www; | ||
index index.html; | ||
max_client_body_size 10; | ||
location / { | ||
allow GET; | ||
root first/; | ||
index page.html; | ||
autoindex 1; | ||
} | ||
location /form/ { | ||
allow GET POST; | ||
return 301 http://localhost/form.html; | ||
# index page.html; | ||
location /data/ { | ||
allow GET DELETE; | ||
autoindex 1; | ||
root uploads; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
server { | ||
listen 4344; | ||
server_name foo; | ||
root www/first; | ||
index page.html; | ||
cgi .php ./cgis/php-cgi; | ||
location / { | ||
allow GET; | ||
} | ||
} | ||
|
||
server { | ||
listen 4343; | ||
server_name foo; | ||
root www/site1; | ||
index index.html; | ||
cgi .php ./cgis/php-cgi; | ||
location / { | ||
allow GET; | ||
} | ||
} | ||
|
||
server { | ||
listen 4343; | ||
server_name bar; | ||
root www/site2; | ||
index index.html; | ||
cgi .php ./cgis/php-cgi; | ||
location / { | ||
allow GET; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
server { | ||
listen 6969; | ||
cgi .php /usr/bin/php-cgi; | ||
cgi .py /usr/bin/python; | ||
root www; | ||
index index.html; | ||
max_client_body_size -1; | ||
location / { | ||
allow GET; | ||
autoindex 0; | ||
index trick.html; | ||
} | ||
location /php { | ||
allow GET POST; | ||
autoindex 1; | ||
root /site1; | ||
} | ||
location /py { | ||
allow GET POST; | ||
autoindex 1; | ||
root /site2; | ||
} | ||
location /downloads { | ||
allow GET DELETE; | ||
autoindex 1; | ||
root /uploads; | ||
} | ||
} |
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
body { | ||
/*margin: 25px;*/ | ||
background-color: orange; | ||
color: red; | ||
border: 200px; | ||
/*font-family: arial, sans-serif;*/ | ||
/*font-size: 14px;*/ | ||
} | ||
div { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100%; | ||
} | ||
/* Applies to all <h1>...</h1> elements. */ | ||
/* h1 { | ||
font-size: 35px; | ||
font-weight: bold; | ||
margin-top: 5px; | ||
} */ | ||
|
||
img { | ||
max-width: 100%; | ||
height: auto; | ||
} | ||
|
||
/* Applies to all elements with <... class="someclass"> specified. */ | ||
/*.someclass { color: red; }*/ | ||
|
||
/* Applies to the element with <... id="someid"> specified. */ | ||
/*#someid { color: green; }*/ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<html lang="en"> | ||
<body style="background-color: darkslateblue; color: lightgrey;"> | ||
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%;"> | ||
<h1>form.html</h1> | ||
|
||
|
||
<?php | ||
|
||
if(isset($_GET["s1"]) || isset($_GET["s2"])) | ||
{ | ||
echo "Using the GET method to pass data<br/>"; | ||
echo "s1 is ".$_GET["s1"].".<br/>"; | ||
echo "s2 is ".$_GET["s2"].".<br/>"; | ||
} | ||
else if(isset($_POST["s1"]) || isset($_POST["s2"])) | ||
{ | ||
echo "Using the POST method to pass data<br/>"; | ||
echo "s1 is ".$_POST["s1"].".<br/>"; | ||
echo "s2 is ".$_POST["s2"].".<br/>"; | ||
} | ||
?> | ||
|
||
<h2>Post mode</h2> | ||
<form action="/simple_form.php" method="post"> | ||
<p>s1: <input type="text" name="s1" /></p> | ||
<p>s2: <input type="text" name="s2" /></p> | ||
<p><input type="submit" /></p> | ||
</form> | ||
|
||
<h2>Get mode</h2> | ||
<form action="/simple_form.php" method="get"> | ||
<p>s1: <input type="text" name="s1" /></p> | ||
<p>s2: <input type="text" name="s2" /></p> | ||
<p><input type="submit" /></p> | ||
</form> | ||
|
||
|
||
|
||
|
||
</form> | ||
</div> | ||
</body> | ||
</html> |
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
body { | ||
/*margin: 25px;*/ | ||
background-color: orange; | ||
color: red; | ||
border: 200px; | ||
/*font-family: arial, sans-serif;*/ | ||
/*font-size: 14px;*/ | ||
} | ||
div { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100%; | ||
} | ||
/* Applies to all <h1>...</h1> elements. */ | ||
/* h1 { | ||
font-size: 35px; | ||
font-weight: bold; | ||
margin-top: 5px; | ||
} */ | ||
|
||
img { | ||
max-width: 100%; | ||
height: auto; | ||
} | ||
|
||
/* Applies to all elements with <... class="someclass"> specified. */ | ||
/*.someclass { color: red; }*/ | ||
|
||
/* Applies to the element with <... id="someid"> specified. */ | ||
/*#someid { color: green; }*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<link rel="stylesheet" href="hello.css"> | ||
<script src="hello.js"></script> | ||
<meta charset="UTF-8"> | ||
</head> | ||
<body> | ||
<div> | ||
<h1>hello.html</h1> | ||
<button onclick="myFunction()"> | ||
Hello | ||
</button> | ||
<img src="doge.png"> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
function myFunction() | ||
{ | ||
alert("Hello world :-)") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<html lang="en"> | ||
<body style="background-color: grey; color: lightgrey;"> | ||
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%;"> | ||
<h1>Landing page</h1> | ||
<a href="hello.html">Demo page</a> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<html lang="en"> | ||
<body style="background-color: darkslateblue; color: lightgrey;"> | ||
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%;"> | ||
<h1>Passing form data to PHP-CGI</h1> | ||
|
||
|
||
<?php | ||
|
||
if(isset($_GET["s1"]) || isset($_GET["s2"])) | ||
{ | ||
echo "Using the GET method to pass data<br/>"; | ||
echo "s1 is ".$_GET["s1"].".<br/>"; | ||
echo "s2 is ".$_GET["s2"].".<br/>"; | ||
} | ||
else if(isset($_POST["s1"]) || isset($_POST["s2"])) | ||
{ | ||
echo "Using the POST method to pass data<br/>"; | ||
echo "s1 is ".$_POST["s1"].".<br/>"; | ||
echo "s2 is ".$_POST["s2"].".<br/>"; | ||
} | ||
?> | ||
|
||
<h2>Post mode</h2> | ||
<form action="/one/form.php" method="post"> | ||
<p>s1: <input type="text" name="s1" /></p> | ||
<p>s2: <input type="text" name="s2" /></p> | ||
<p><input type="submit" /></p> | ||
</form> | ||
|
||
<h2>Get mode</h2> | ||
<form action="/one/form.php" method="get"> | ||
<p>s1: <input type="text" name="s1" /></p> | ||
<p>s2: <input type="text" name="s2" /></p> | ||
<p><input type="submit" /></p> | ||
</form> | ||
|
||
|
||
|
||
|
||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<html lang="en"> | ||
<body style="background-color: grey; color: lightgrey;"> | ||
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%;"> | ||
<h1>index of site1 called index.html</h1> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.