Web Security Task #162280
-
Select Topic AreaQuestion BodyI’m currently working on implementing security headers for the website https://boctrustmfb.com. The headers I’m focusing on include: Current Situation: I also tried to add the headers manually via the Nginx configuration file using SSH — the configuration seems fine and the headers are included there. Testing: I also checked the Network tab (Response Headers) in browser DevTools the headers are missing from the main website responses. Questions / Possible Causes: If we’ve defined the headers in Nginx, why are they not visible on the live site responses? Could it be due to: The backend overriding Nginx headers? The Nginx headers not being applied to all location blocks? The headers not applied with always, so only working on 200 responses? Or maybe a reverse proxy setup that skips certain configs? Reference: |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 2 replies
-
|
try accessing your backend from the server it's deployed in, or run the production build on your machine with no reverse proxy(nginx) and test it using curl from the command line. chatgpt can help you with commands just give it the endpoints. if you can see the headers, it's your reverse proxy that is misconfigured. |
Beta Was this translation helpful? Give feedback.
-
Troubleshooting Security Headers ImplementationGreat question! Security headers not showing up despite backend and Nginx configuration is a common issue. Let me help you diagnose and fix this step by step. Immediate Debugging Steps
# Test main page
curl -I https://boctrustmfb.com
# Test API endpoint
curl -I https://boctrustmfb.com/api/some-endpoint
# Test with verbose output
curl -v https://boctrustmfb.comCheck Nginx configuration priority:# Make sure headers are in the correct location block
server {
# Global headers (apply to all locations)
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
location / {
# Frontend/static files
# Headers should inherit from server block
}
location /api/ {
# API routes
proxy_pass http://backend;
# Headers should also be applied here
}
} |
Beta Was this translation helpful? Give feedback.
-
|
Possible Causes:
|
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
Issue Resolved |
Beta Was this translation helpful? Give feedback.
🕒 Discussion Activity Reminder 🕒
This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions:
1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as
out of dateat the bottom of the page.2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own.
3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution.
Note: This dormant notification will only apply to Discussions with the
Questionlabel. To learn more, see our recent announcement.T…