From 8160ad18e0e25b1d3d1a60c9691e9125cfe0aa39 Mon Sep 17 00:00:00 2001 From: timbastin <bastin.tim@gmail.com> Date: Wed, 11 May 2022 18:02:19 +0200 Subject: [PATCH] Changed nginx.conf --- prak/pr05/nginx.conf | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/prak/pr05/nginx.conf b/prak/pr05/nginx.conf index 5c5d823..8b5e168 100644 --- a/prak/pr05/nginx.conf +++ b/prak/pr05/nginx.conf @@ -2,13 +2,25 @@ events {} http { + server { + # listen on port 80 and 443 for ipv4 and ipv6 requests + listen 80; + listen [::]:80; + server_name _; + + # there is no server name provided here - match anything else + location / { + # return the error index.html + root /www/data/error; + } + } server { # listen on port 80 and 443 for ipv4 and ipv6 requests listen 80; listen [::]:80; # if the requested hostname does match one of the following, check the location block. - server_name localhost tbasti2s.l3montree.com tbasti2s.l3montree.education; + server_name localhost www.tbasti2s.l3montree.education tbasti2s.l3montree.com tbasti2s.l3montree.education; location / { # always return static files @@ -22,7 +34,7 @@ http { listen [::]:80; # if the requested hostname does match one of the following, check the location block. - server_name http://miniwhoami-loc1.tbasti2s.l3montree.education; + server_name miniwhoami-loc1.tbasti2s.l3montree.education www.miniwhoami-loc1.tbasti2s.l3montree.com miniwhoami-loc1.tbasti2s.l3montree.education; location / { # always return static files @@ -36,7 +48,7 @@ http { listen [::]:80; # if the requested hostname does match one of the following, check the location block. - server_name http://miniwhoami-loc2.tbasti2s.l3montree.education; + server_name miniwhoami-loc2.tbasti2s.l3montree.education www.miniwhoami-loc2.tbasti2s.l3montree.com miniwhoami-loc2.tbasti2s.l3montree.education; location / { # always return static files @@ -50,25 +62,11 @@ http { listen [::]:80; # if the requested hostname does match one of the following, check the location block. - server_name http://echo.tbasti2s.l3montree.education; + server_name echo.tbasti2s.l3montree.education www.echo.tbasti2s.l3montree.education; location / { # always return static files proxy_pass http://echo:8080; } } - - - server { - # listen on port 80 and 443 for ipv4 and ipv6 requests - listen 80 default; - listen [::]:80 default; - server_name _; - - # there is no server name provided here - match anything else - location / { - # return the error index.html - root /www/data/error; - } - } } \ No newline at end of file -- GitLab