--- /dev/null
+# Copyright (c) 2023 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+
+server {
+ server_name gym.${private_domain};
+
+ listen [::]:443 ssl http2;
+ listen 443 ssl http2;
+
+ ssl_certificate ${private_ssl_cert_dir}/fullchain.pem;
+ ssl_certificate_key ${private_ssl_cert_dir}/privkey.pem;
+
+ ssl_client_certificate ${ca_dir}/ca.pem;
+ ssl_verify_client on;
+
+ root ${prod_dir}/gym;
+
+ location ~ ^/record(.*) {
+ include fastcgi_params;
+ fastcgi_pass unix:/var/run/fcgiwrap.socket;
+ fastcgi_param DATE ${dollar}arg_date;
+ fastcgi_param GYM ${dollar}arg_gym;
+ fastcgi_param SCRIPT_FILENAME ${dollar}document_root/record.sh;
+ }
+
+ location ~ ^/(exercise|gym|workout)$ {
+ include fastcgi_params;
+ fastcgi_pass unix:/var/run/fcgiwrap.socket;
+ fastcgi_param RECORD_TYPE ${dollar}1;
+ fastcgi_param REQUEST_BODY ${dollar}request_body;
+ fastcgi_param SCRIPT_FILENAME ${dollar}document_root/insert.sh;
+ }
+
+ location = / {
+ include fastcgi_params;
+ fastcgi_pass unix:/var/run/fcgiwrap.socket;
+ fastcgi_param SCRIPT_FILENAME ${dollar}document_root/gym.sh;
+ }
+}
+
+server {
+ server_name gym.${private_domain};
+
+ listen [::]:80;
+ listen 80;
+
+ if (${dollar}host = gym.${private_domain}) {
+ return 301 https://${dollar}host${dollar}request_uri;
+ }
+
+ return 404;
+}