Move TLS config to nginx.conf, add client_max_body_size 100m;

This commit is contained in:
Disassembler 2017-09-18 17:50:13 +02:00
parent c58af273a7
commit bcf960dce4
5 changed files with 98 additions and 27 deletions

View File

@ -83,9 +83,12 @@ apt-get -y --no-install-recommends install nginx-light uwsgi uwsgi-plugin-python
openssl req -x509 -new -out /etc/ssl/certs/services.pem -keyout /etc/ssl/private/services.key -nodes -days 3654 -subj "/C=CZ/CN=$(hostname -f)" openssl req -x509 -new -out /etc/ssl/certs/services.pem -keyout /etc/ssl/private/services.key -nodes -days 3654 -subj "/C=CZ/CN=$(hostname -f)"
chmod 640 /etc/ssl/private/services.key chmod 640 /etc/ssl/private/services.key
# Modify default nginx site # Configure nginx
mkdir /etc/nginx/apps-available /etc/nginx/apps-enabled mkdir /etc/nginx/apps-available /etc/nginx/apps-enabled
cp ${SOURCE_DIR}/basic/etc/nginx/nginx.conf /etc/nginx/nginx.conf
cp ${SOURCE_DIR}/basic/etc/nginx/sites-available/default /etc/nginx/sites-available/default cp ${SOURCE_DIR}/basic/etc/nginx/sites-available/default /etc/nginx/sites-available/default
# Copy Portal resources
cp -r ${SOURCE_DIR}/basic/srv/portal /srv/portal cp -r ${SOURCE_DIR}/basic/srv/portal /srv/portal
chown -R www-data:www-data /srv/portal chown -R www-data:www-data /srv/portal

View File

@ -0,0 +1,94 @@
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
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;
include /etc/nginx/mime.types;
default_type application/octet-stream;
client_max_body_size 100m;
##
# SSL Settings
##
ssl_protocols TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 1d;
ssl_session_tickets off;
ssl_certificate /etc/ssl/certs/services.pem;
ssl_certificate_key /etc/ssl/private/services.key;
##
# 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/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}

View File

@ -8,14 +8,6 @@ server {
listen 443 ssl http2; listen 443 ssl http2;
listen [::]:443 ssl http2; listen [::]:443 ssl http2;
ssl_certificate /etc/ssl/certs/services.pem;
ssl_certificate_key /etc/ssl/private/services.key;
ssl_protocols TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 1d;
ssl_session_tickets off;
add_header Strict-Transport-Security "max-age=31536000;"; add_header Strict-Transport-Security "max-age=31536000;";
root /srv/portal; root /srv/portal;

View File

@ -2,15 +2,6 @@ server {
listen 8001 ssl http2; listen 8001 ssl http2;
listen [::]:8001 ssl http2; listen [::]:8001 ssl http2;
ssl_certificate /etc/ssl/certs/services.pem;
ssl_certificate_key /etc/ssl/private/services.key;
ssl_protocols TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 1d;
ssl_session_tickets off;
access_log /var/log/nginx/pandora.access.log; access_log /var/log/nginx/pandora.access.log;
error_log /var/log/nginx/pandora.error.log; error_log /var/log/nginx/pandora.error.log;

View File

@ -2,15 +2,6 @@ server {
listen 8099 ssl http2; listen 8099 ssl http2;
listen [::]:8099 ssl http2; listen [::]:8099 ssl http2;
ssl_certificate /etc/ssl/certs/services.pem;
ssl_certificate_key /etc/ssl/private/services.key;
ssl_protocols TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 1d;
ssl_session_tickets off;
access_log /var/log/nginx/sambro.access.log; access_log /var/log/nginx/sambro.access.log;
error_log /var/log/nginx/sambro.error.log; error_log /var/log/nginx/sambro.error.log;