No final, eu consegui trabalhar assim ...
#/etc/nginx/sites-enabled/default
server_tokens off;
add_header X-Frame-Options SAMEORIGIN;
add_header X-XSS-Protection "1; mode=block";
server {
listen 80;
server_name _;
return 301 https://wifi.domain.com.au$request_uri;
error_log /var/log/unifi/nginx.log;
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /var/www/html/letsencrypt;
}
}
server {
listen 443 ssl default_server http2;
server_name wifi.domain.com.au;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
ssl_certificate /etc/letsencrypt/live/wifi.domain.com.au/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/wifi.domain.com.au/privkey.pem;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
keepalive_timeout 300;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_stapling on;
ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA;
add_header Strict-Transport-Security max-age=31536000;
add_header X-Frame-Options DENY;
error_log /var/log/unifi/nginx.log;
client_max_body_size 8M;
proxy_cache off;
proxy_store off;
location / {
include /etc/nginx/proxy_params;
proxy_pass https://127.0.0.1:8443$request_uri;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /admin {
include /etc/nginx/proxy_params;
proxy_pass http://127.0.0.1:81$request_uri;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Eu tentei e guardei tudo em nginx, mas tive um tempo horrível tentando fazer com que os scripts php funcionassem por ele, passei muitas horas pesquisando blocos nginx php e tentando a miríade de supostas correções ... desisti ... lighttpd para o resgate
Lighthttpd instalado, e definir sua porta para 81 e php trabalhando fora da caixa
Agora, posso acessar meu controlador unifi na URL principal de subdomínio, ou seja, o link e as novas páginas php em link todo o bem