fuel-library/deployment/puppet/nailgun/templates/nginx.conf.erb
Andrey Bubyr f3bbdb9f48 Fix clickjacking attack vulnerability in nginx
For Fuel web interface and other sites served by nginx on fuel master
we should use X-Frame-Options SAMEORIGIN to prevent from clickjacking,
e.g. the page can only be displayed in a frame on the same
origin as the page itself.

Change-Id: Ie8d6e4e92222ac9bb7c489dd0a5aff833fabe873
Closes-Bug: #1497194
2015-11-16 20:45:23 +02:00

45 lines
1.2 KiB
Plaintext

user nginx;
worker_processes <%= [[@processorcount.to_i, 2].min, @processorcount.to_i / 2].max %>;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
# don't buffer data-sends (disable Nagle algorithm).
# Good for sending frequent small bursts of data in real time.
tcp_nodelay on;
#keepalive_timeout 0;
keepalive_timeout 65;
server_tokens off;
#gzip on;
#prefer server ciphers over client ones
ssl_prefer_server_ciphers on;
#prevent from clickjacking attacks
add_header X-Frame-Options SAMEORIGIN;
# Load config files from the /etc/nginx/conf.d directory
# The default server is in conf.d/default.conf
include /etc/nginx/conf.d/*.conf;
}