access_log /var/log/nginx/notes.mydomain.com_access_log main; error_log /var/log/nginx/notes.mydomain.com_error_log info; # login protected access from outside server { server_name notes.mydomain.com; listen 8443 ssl; http2 on; include "com.mydomain/authelia_location.conf"; location / { include "com.mydomain/authelia_proxy.conf"; include "com.mydomain/authelia_authrequest.conf"; if ($http_origin = ''){ set $http_origin "*"; } proxy_hide_header Access-Control-Allow-Origin; add_header Access-Control-Allow-Origin $http_origin; client_max_body_size 512M; proxy_pass http://127.0.0.1:8001$uri; } } # Manage direct request inside home network # It's identical to the remote one, but it has no authentication # HTTPS on port 443 for direct local connections server { server_name notes.mydomain.com; listen 443 ssl; http2 on; location / { if ($http_origin = ''){ set $http_origin "*"; } proxy_hide_header Access-Control-Allow-Origin; add_header Access-Control-Allow-Origin $http_origin; client_max_body_size 512M; proxy_pass http://127.0.0.1:8001$uri; } }