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

Security policy for the reverse proxy #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
21 changes: 21 additions & 0 deletions docker/SERVER/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,24 @@ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;

## Security Configuration

# Do not allow the browser to render the page inside an frame or iframe and avoid clickjacking
# Allow iframes only from the same origin by setting to 'SAMEORIGIN'
add_header X-Frame-Options SAMEORIGIN;

# Disable content-type sniffing
add_header X-Content-Type-Options nosniff;

# Cross-site scripting (XSS) filter
add_header X-XSS-Protection "1; mode=block";

# Content Security Policy (CSP)
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; form-action 'self'; frame-ancestors 'none'; object-src 'none';";

# Enable HSTS(HTTP Strict Transport Security)
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload";

# Do not leak server info such as the nginx version number in error pages or the server headers
server_tokens off;