NGINX configs for Thulium
Go to file
Jonathan Chan 89e0a67b18
Create README.md
2018-07-02 18:27:39 -07:00
README.md Create README.md 2018-07-02 18:27:39 -07:00
al.ert.space Added config for al.ert.space; ex.ert.space now points to Nextcloud. 2018-06-02 16:35:09 -07:00
default Initial commit. 2018-04-24 00:52:31 -07:00
ert.space Raised client_max_body_size in hilb.ert.space to 5M; added config for ert.space 2018-06-10 21:52:57 -07:00
ex.ert.space Lowered client_max_body_size in ex.ert.space to 512M. 2018-06-03 08:37:18 -07:00
gitb.ert.space Initial commit. 2018-04-24 00:52:31 -07:00
hilb.ert.space Raised client_max_body_size in hilb.ert.space to 5M; added config for ert.space 2018-06-10 21:52:57 -07:00
in.ert.space Initial commit. 2018-04-24 00:52:31 -07:00
ress.ert.space Added ress.ert.space for Tiny Tiny RSS 2018-06-03 18:52:12 -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.ert.space will point to files in /srv/www/example.ert.space.

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

PHP site with HTTP authentication

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

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

    root /srv/www/example.ert.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:/run/php/php7.0-fpm.sock;
    }

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

Reverse proxy

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

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