mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
44 lines
1.4 KiB
Text
44 lines
1.4 KiB
Text
server {
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server;
|
|
|
|
location / {
|
|
return 302 https://$http_host/yunohost/admin;
|
|
}
|
|
|
|
location /yunohost/admin {
|
|
return 301 https://$http_host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2 default_server;
|
|
listen [::]:443 ssl http2 default_server;
|
|
|
|
include /etc/nginx/conf.d/security.conf.inc;
|
|
|
|
ssl_certificate /etc/yunohost/certs/yunohost.org/crt.pem;
|
|
ssl_certificate_key /etc/yunohost/certs/yunohost.org/key.pem;
|
|
|
|
more_set_headers "Strict-Transport-Security : max-age=63072000; includeSubDomains; preload";
|
|
more_set_headers "Referrer-Policy : 'same-origin'";
|
|
more_set_headers "Content-Security-Policy : upgrade-insecure-requests; object-src 'none'; script-src https: 'unsafe-eval'";
|
|
|
|
location / {
|
|
return 302 https://$http_host/yunohost/admin;
|
|
}
|
|
|
|
location /yunohost {
|
|
# Block crawlers bot
|
|
if ($http_user_agent ~ (crawl|Googlebot|Slurp|spider|bingbot|tracker|click|parser|spider|facebookexternalhit) ) {
|
|
return 403;
|
|
}
|
|
# X-Robots-Tag to precise the rules applied.
|
|
add_header X-Robots-Tag "nofollow, noindex, noarchive, nosnippet";
|
|
# Redirect most of 404 to maindomain.tld/yunohost/sso
|
|
access_by_lua_file /usr/share/ssowat/access.lua;
|
|
}
|
|
|
|
include /etc/nginx/conf.d/yunohost_admin.conf.inc;
|
|
include /etc/nginx/conf.d/yunohost_api.conf.inc;
|
|
}
|