fix: add security headers to nginx config#8
Merged
wicky-zipstack merged 2 commits intomainfrom Mar 26, 2026
Merged
Conversation
jaseemjaskp
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
frontend/nginx.confto address VAPT findingsWhy
SecurityHeadersMiddleware) already adds these headers to API responses, but static files served by nginx (HTML, JS, CSS) had no security headersHow
Added 4 security headers to the
serverblock infrontend/nginx.conf:X-Frame-Options: DENY— prevents the page from being embedded in iframes (anti-clickjacking)X-Content-Type-Options: nosniff— prevents MIME type sniffingReferrer-Policy: strict-origin-when-cross-origin— controls referrer information sent with requestsContent-Security-Policy— restricts content sources to prevent XSS:default-src 'self'— only allow same-origin by defaultscript-src 'self' 'unsafe-inline' 'unsafe-eval'— required for Reactconnect-src 'self' https://*.visitran.com wss://*.visitran.com— allow API and WebSocket connectionsframe-ancestors 'none'— modern replacement for X-Frame-OptionsCan this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)
app.visitran.com) — app loads and functions correctly with these headers. Thealwaysdirective ensures headers are sent on all response codes including errors.Database Migrations
Env Config
Relevant Docs
Related Issues or PRs
pluggable_apps/middleware/security_headers.py(cloud repo)Dependencies Versions
Notes on Testing
Screenshots
N/A — verified via curl headers.
Checklist