Skip to content

Instantly share code, notes, and snippets.

@peterjaap
Last active October 31, 2024 11:53
Show Gist options
  • Save peterjaap/0df13090afd5012818a58b8adb1b4cbe to your computer and use it in GitHub Desktop.
Save peterjaap/0df13090afd5012818a58b8adb1b4cbe to your computer and use it in GitHub Desktop.
Nginx rules for security.txt on Hypernode
# ~/nginx/server.security-txt
# Make Magento 2.4.x's security.txt available to the world
rewrite ^/.well-known/security.txt$ /securitytxt/index/securitytxt last;
rewrite ^/security.txt$ /securitytxt/index/securitytxt last;
# ~/nginx/server.security-txt-magento23
# Running Magento 2.3.x? Create your own security.txt and store it (for example) in /data/web/security.txt
location ~ ^/security.txt$ {
add_header Content-Type text/plain;
alias /data/web/security.txt;
}
location = /.well-known/security.txt {
add_header Content-Type text/plain;
alias /data/web/security.txt;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment