Skip to content
Snippets Groups Projects
nginx.conf 2.21 KiB
Newer Older
timbastin's avatar
timbastin committed
# events is necessary - otherwise the server wont start
timbastin's avatar
timbastin committed
http {

timbastin's avatar
timbastin committed
    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;
        }
    }
timbastin's avatar
timbastin committed
    server {
timbastin's avatar
timbastin committed
        # listen on port 80 and 443 for ipv4 and ipv6 requests
timbastin's avatar
timbastin committed
        listen 80;
        listen [::]:80;
timbastin's avatar
timbastin committed

        # if the requested hostname does match one of the following, check the location block.
timbastin's avatar
timbastin committed
        server_name localhost www.tbasti2s.l3montree.education tbasti2s.l3montree.com tbasti2s.l3montree.education;
timbastin's avatar
timbastin committed

        location / {
timbastin's avatar
timbastin committed
            # always return static files
timbastin's avatar
timbastin committed
            root /www/data;
        }
    }
timbastin's avatar
timbastin committed

    server {
        # listen on port 80 and 443 for ipv4 and ipv6 requests
timbastin's avatar
timbastin committed
        listen 80;
        listen [::]:80;

        # if the requested hostname does match one of the following, check the location block.
timbastin's avatar
timbastin committed
        server_name miniwhoami-loc1.tbasti2s.l3montree.education www.miniwhoami-loc1.tbasti2s.l3montree.com miniwhoami-loc1.tbasti2s.l3montree.education;

        location / {
            # always return static files
timbastin's avatar
timbastin committed
            proxy_pass http://miniwhoami-loc1;
        }
    }

    server {
        # listen on port 80 and 443 for ipv4 and ipv6 requests
timbastin's avatar
timbastin committed
        listen 80;
        listen [::]:80;

        # if the requested hostname does match one of the following, check the location block.
timbastin's avatar
timbastin committed
        server_name miniwhoami-loc2.tbasti2s.l3montree.education www.miniwhoami-loc2.tbasti2s.l3montree.com miniwhoami-loc2.tbasti2s.l3montree.education;

        location / {
            # always return static files
timbastin's avatar
timbastin committed
            proxy_pass http://miniwhoami-loc2;
        }
    }

    server {
        # listen on port 80 and 443 for ipv4 and ipv6 requests
timbastin's avatar
timbastin committed
        listen 80;
        listen [::]:80;

        # if the requested hostname does match one of the following, check the location block.
timbastin's avatar
timbastin committed
        server_name echo.tbasti2s.l3montree.education www.echo.tbasti2s.l3montree.education;

        location / {
            # always return static files
timbastin's avatar
timbastin committed
            proxy_pass http://echo:8080;
timbastin's avatar
timbastin committed
}