server { listen 80 default_server; listen [::]:80 default_server; location / { rewrite ^ https://$http_host/yunohost/admin permanent; } location /yunohost/admin { rewrite ^ https://$http_host$request_uri? permanent; } } server { listen 443 ssl default_server; listen [::]:443 ssl default_server; ssl_certificate /etc/yunohost/certs/yunohost.org/crt.pem; ssl_certificate_key /etc/yunohost/certs/yunohost.org/key.pem; ssl_session_timeout 5m; ssl_session_cache shared:SSL:50m; ssl_prefer_server_ciphers on; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ALL:!aNULL:!eNULL:!LOW:!EXP:!RC4:!3DES:+HIGH:+MEDIUM; add_header Strict-Transport-Security "max-age=31536000;"; location / { rewrite ^ https://$http_host/yunohost/admin permanent; } # Block crawlers bot location /yunohost { if ($http_user_agent ~ (crawl|Googlebot|Slurp|spider|bingbot|tracker|click|parser|spider|facebookexternalhit) ) { return 403; } } include conf.d/yunohost_admin.conf.inc; include conf.d/yunohost_api.conf.inc; }