Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add ngnix security headers #964

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add ngnix security
  • Loading branch information
Agastya18 committed Dec 5, 2024
commit c72d9f7720e9dc96cb7673292e2bb8882d49bbc9
12 changes: 12 additions & 0 deletions nginx-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,17 @@ server {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri /index.html;

# Add security headers
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options SAMEORIGIN;
add_header X-XSS-Protection "1; mode=block";
add_header Referrer-Policy no-referrer-when-downgrade;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' https://www.google-analytics.com https://www.googletagmanager.com; style-src 'self' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; connect-src 'self' *.hasadna.org.il;";

# CORS settings
add_header Access-Control-Allow-Origin "self https://www.google-analytics.com https://www.googletagmanager.com https://fonts.gstatic.com https://fonts.googleapis.com *.hasadna.org.il";
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept";
NoamGaash marked this conversation as resolved.
Show resolved Hide resolved
}
}
Loading