| 1 | #/etc/nginx/nginx.conf:
|
|---|
| 2 | ################################################################################
|
|---|
| 3 | user nginx;
|
|---|
| 4 | worker_processes auto;
|
|---|
| 5 | error_log /var/log/nginx/error.log;
|
|---|
| 6 | pid /run/nginx.pid;
|
|---|
| 7 |
|
|---|
| 8 | events {
|
|---|
| 9 | worker_connections 1024;
|
|---|
| 10 | }
|
|---|
| 11 |
|
|---|
| 12 | http {
|
|---|
| 13 | log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|---|
| 14 | '$status $body_bytes_sent "$http_referer" '
|
|---|
| 15 | '"$http_user_agent" "$http_x_forwarded_for" $request_id';
|
|---|
| 16 |
|
|---|
| 17 | access_log /var/log/nginx/access.log main;
|
|---|
| 18 | error_log /var/log/nginx/error.log error;
|
|---|
| 19 |
|
|---|
| 20 | sendfile on;
|
|---|
| 21 | tcp_nopush on;
|
|---|
| 22 | tcp_nodelay on;
|
|---|
| 23 | keepalive_timeout 65;
|
|---|
| 24 | types_hash_max_size 2048;
|
|---|
| 25 |
|
|---|
| 26 | client_body_buffer_size 32k;
|
|---|
| 27 | client_header_buffer_size 32k;
|
|---|
| 28 | large_client_header_buffers 4 32k;
|
|---|
| 29 |
|
|---|
| 30 | proxy_buffer_size 128k;
|
|---|
| 31 | proxy_buffers 4 256k;
|
|---|
| 32 | proxy_busy_buffers_size 256k;
|
|---|
| 33 |
|
|---|
| 34 | server_tokens off;
|
|---|
| 35 |
|
|---|
| 36 | include /etc/nginx/mime.types;
|
|---|
| 37 | default_type application/octet-stream;
|
|---|
| 38 |
|
|---|
| 39 | # Load modular configuration files from the /etc/nginx/conf.d directory.
|
|---|
| 40 | # See http://nginx.org/en/docs/ngx_core_module.html#include
|
|---|
| 41 | # for more information.
|
|---|
| 42 | include /etc/nginx/conf.d/*.conf;
|
|---|
| 43 |
|
|---|
| 44 | }
|
|---|
| 45 |
|
|---|
| 46 | #/etc/nginx/conf.d/domain.conf
|
|---|
| 47 | ################################################################################
|
|---|
| 48 | server {
|
|---|
| 49 | listen 80;
|
|---|
| 50 | server_name .domain.com;
|
|---|
| 51 |
|
|---|
| 52 | return 301 https://$host$request_uri;
|
|---|
| 53 | }
|
|---|
| 54 |
|
|---|
| 55 | server {
|
|---|
| 56 | listen 443 ssl;
|
|---|
| 57 | server_name .domain.com;
|
|---|
| 58 |
|
|---|
| 59 | ssl on;
|
|---|
| 60 | ssl_certificate /ssl/domain_com.chained.crt;
|
|---|
| 61 | ssl_certificate_key /ssl/domain_com.key;
|
|---|
| 62 |
|
|---|
| 63 | ssl_session_timeout 1d;
|
|---|
| 64 | ssl_session_cache shared:SSL:50m;
|
|---|
| 65 | ssl_session_tickets off;
|
|---|
| 66 |
|
|---|
| 67 | add_header Strict-Transport-Security "max-age=31557600; includeSubDomains";
|
|---|
| 68 | add_header X-Content-Type-Options "nosniff" always;
|
|---|
| 69 | add_header X-Frame-Options "SAMEORIGIN" always;
|
|---|
| 70 | add_header X-Xss-Protection "1; mode=block" always;
|
|---|
| 71 |
|
|---|
| 72 | ssl_dhparam /ssl/dh_param.pem;
|
|---|
| 73 |
|
|---|
| 74 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
|---|
| 75 | 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:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
|
|---|
| 76 | ssl_prefer_server_ciphers on;
|
|---|
| 77 |
|
|---|
| 78 | ssl_stapling on;
|
|---|
| 79 | ssl_stapling_verify on;
|
|---|
| 80 | ssl_trusted_certificate /ssl/ca-cert.pem;
|
|---|
| 81 |
|
|---|
| 82 | access_log /var/log/nginx/access_443.log main;
|
|---|
| 83 | error_log /var/log/nginx/error_443.log error;
|
|---|
| 84 |
|
|---|
| 85 | include /etc/nginx/location.d/*.conf;
|
|---|
| 86 |
|
|---|
| 87 | }
|
|---|
| 88 |
|
|---|
| 89 | #/etc/nginx/location.d/authorization.conf
|
|---|
| 90 | ################################################################################
|
|---|
| 91 | location /uaa/ {
|
|---|
| 92 |
|
|---|
| 93 | access_log /var/log/nginx/auth/access.log main;
|
|---|
| 94 | error_log /var/log/nginx/auth/error.log error;
|
|---|
| 95 |
|
|---|
| 96 | proxy_pass http://localhost:9999/uaa/;
|
|---|
| 97 | proxy_http_version 1.1;
|
|---|
| 98 | proxy_read_timeout 1200;
|
|---|
| 99 | proxy_connect_timeout 240;
|
|---|
| 100 |
|
|---|
| 101 | proxy_set_header Host $host;
|
|---|
| 102 | proxy_set_header X-Real-IP $remote_addr;
|
|---|
| 103 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|---|
| 104 | proxy_set_header X-Forwarded-Host $host;
|
|---|
| 105 | proxy_set_header X-Forwarded-Proto $scheme;
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 | proxy_set_header InteractionID $request_id;
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 | client_max_body_size 100M;
|
|---|
| 112 | }
|
|---|