NGINX configs for Thulium
Go to file
Jonathan Chan 48855dabfa
Update README.md
2021-05-14 23:44:57 -07:00
README.md Update README.md 2021-05-14 23:44:57 -07:00
al.ert.space Added Nitter and fixed whitespace. 2021-03-24 05:20:31 +00:00
conc.ert.space Add wiki.ert.space; fix newlines for all files. 2020-05-05 22:43:27 -07:00
default Added configs for ionathan.ch domains. 2020-10-21 23:17:02 -07:00
doi.ionathan.ch Added Nitter and fixed whitespace. 2021-03-24 05:20:31 +00:00
ert.space Added Nitter and fixed whitespace. 2021-03-24 05:20:31 +00:00
ex.ert.space Added Nitter and fixed whitespace. 2021-03-24 05:20:31 +00:00
git.ionathan.ch Added Nitter and fixed whitespace. 2021-03-24 05:20:31 +00:00
gitb.ert.space Add wiki.ert.space; fix newlines for all files. 2020-05-05 22:43:27 -07:00
hilb.ert.space Added configs for ionathan.ch domains. 2020-10-21 23:17:02 -07:00
in.ert.space Add wiki.ert.space; fix newlines for all files. 2020-05-05 22:43:27 -07:00
next.ionathan.ch Added Nitter and fixed whitespace. 2021-03-24 05:20:31 +00:00
nitter.ionathan.ch Added Nitter and fixed whitespace. 2021-03-24 05:20:31 +00:00
pix.ert.space Add wiki.ert.space; fix newlines for all files. 2020-05-05 22:43:27 -07:00
ress.ert.space Add wiki.ert.space; fix newlines for all files. 2020-05-05 22:43:27 -07:00
rss.ionathan.ch Added Nitter and fixed whitespace. 2021-03-24 05:20:31 +00:00
stand.ert.space Add wiki.ert.space; fix newlines for all files. 2020-05-05 22:43:27 -07:00
wiki.ert.space Add wiki.ert.space; fix newlines for all files. 2020-05-05 22:43:27 -07:00

README.md

Templates

These NGINX configurations set up HTTP servers at port 80. HTTPS on port 443 should be set up using certbot.

Static web page

The URL example.space will point to files in /srv/www/example.space.

server {
    listen 80;
    listen [::]:80;
    root /srv/www/example.space;
    server_name example.space;
    error_page 404 /404.html;
    location / {
        try_files $uri $uri/ =404;
    }
}

Reverse proxy

The URL example.space will point to the local port 8080.

server {
    listen 80;
    listen [::]:80;
    client_max_body_size 512M;
    server_name example.space;
    location / {
        proxy_pass http://localhost:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

PHP site with HTTP authentication

The URL example.space will point to the PHP application at /srv/www/example.space/index.php. HTTP authentication done as indicated here.

server {
    listen 80;
    listen [::]:80;
    server_name example.space;

    root /srv/www/example.space;
    index index.html index.php;

    # set up HTTP basic authentication
    auth_basic           "Authentication Required";
    auth_basic_user_file /etc/apache2/.htpasswd;

    location / {
        try_files $uri $uri/ =404;
    }

    # process PHP requests
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}