Skip to content

Latest commit

 

History

History
142 lines (113 loc) · 3.29 KB

nginx.md

File metadata and controls

142 lines (113 loc) · 3.29 KB

NGINX Configuration

This file currently contains the config for the auto scaling cluster, which means it also has the configuration and setup details for:

  • cmp-pixel

There is no guarantee that these files are up to date

/etc/nginx/nginx.conf

user www-data;
worker_processes auto;
pid /run/nginx.pid;

events {
	worker_connections 768;
	# multi_accept on;
}

http {

	##
	# Basic Settings
	##

	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	# server_tokens off;

	# server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

	geoip_country /usr/share/GeoIP/GeoIP.dat;

	include /etc/nginx/mime.types;
	default_type application/octet-stream;

	##
	# SSL Settings
	##

	ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
	ssl_prefer_server_ciphers on;

	##
	# Logging Settings
	##

	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log;

	##
	# Gzip Settings
	##

	gzip on;
	gzip_disable "msie6";

	# gzip_vary on;
	# gzip_proxied any;
	# gzip_comp_level 6;
	# gzip_buffers 16 8k;
	# gzip_http_version 1.1;
	# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

	##
	# Virtual Host Configs
	##

	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;
}

/etc/nginx/sites-enabled/pluto.mgr.consensu.org

# Default server configuration
#
server {
	listen 80 default_server;
	listen [::]:80 default_server;

	# SSL configuration
	#
	listen 443 ssl;
	
	server_name pluto.mgr.consensu.org;
	ssl_certificate /etc/nginx/ssl/ssl-bundle.crt;
	ssl_certificate_key /etc/nginx/ssl/pluto.mgr.consensu.org.key;
	# listen 443 ssl default_server;
	# listen [::]:443 ssl default_server;
	#
	# Note: You should disable gzip for SSL traffic.
	# See: https://bugs.debian.org/773332
	#
	# Read up on ssl_ciphers to ensure a secure configuration.
	# See: https://bugs.debian.org/765782
	#
	# Self signed certs generated by the ssl-cert package
	# Don't use them in a production server!
	#
	# include snippets/snakeoil.conf;

	# root /var/www/html;

	# Add index.php to the list if you are using PHP
	# index index.html index.htm index.nginx-debian.html;

	location / {
	        proxy_pass http://localhost:5000/;
          	proxy_redirect http://localhost:5000/ https://pluto.mgr.consensu.org;
		proxy_http_version 1.1;
		proxy_set_header X-Request-Country $geoip_country_code;
          	proxy_set_header Upgrade $http_upgrade;
          	proxy_set_header Connection 'upgrade';
          	proxy_set_header Host $host;
		proxy_set_header X-Cookie-Euconsent $cookie_euconsent;
          	proxy_cache_bypass $http_upgrade;
		#proxy_cookie_domain localhost .consensu.org;
	}

  #####
  # Consent Pixel application config lives here
  #####

  location /pixel {
	        proxy_pass http://localhost:5001/;
          	proxy_redirect http://localhost:5000/ https://pluto.mgr.consensu.org;
		proxy_http_version 1.1;
		proxy_set_header X-Request-Country $geoip_country_code;
          	proxy_set_header Upgrade $http_upgrade;
          	proxy_set_header Connection 'upgrade';
          	proxy_set_header Host $host;
		proxy_set_header X-Cookie-Euconsent $cookie_euconsent;
          	proxy_cache_bypass $http_upgrade;
		#proxy_cookie_domain localhost .consensu.org;
	}
}