From d0da45960da53ed5c602b6c16277eefadc03ef0e Mon Sep 17 00:00:00 2001 From: xiahaoshawn Date: Fri, 25 Mar 2016 17:11:12 +0800 Subject: [PATCH] add cert directory and nginx.https.conf file --- Deploy/config/nginx/cert/.gitignore | 0 Deploy/config/nginx/nginx.https.conf | 85 ++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 Deploy/config/nginx/cert/.gitignore create mode 100644 Deploy/config/nginx/nginx.https.conf diff --git a/Deploy/config/nginx/cert/.gitignore b/Deploy/config/nginx/cert/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/Deploy/config/nginx/nginx.https.conf b/Deploy/config/nginx/nginx.https.conf new file mode 100644 index 000000000..0eb9d25f8 --- /dev/null +++ b/Deploy/config/nginx/nginx.https.conf @@ -0,0 +1,85 @@ +worker_processes auto; + +events { + worker_connections 1024; + use epoll; + multi_accept on; +} + +http { + tcp_nodelay on; + + # this is necessary for us to be able to disable request buffering in all cases + proxy_http_version 1.1; + + + upstream registry { + server registry:5000; + } + + upstream ui { + server ui:80; + } + + + server { + listen 443 ssl; + server_name harbordomian.com; + + # SSL + ssl_certificate /etc/nginx/conf.d/harbordomian.crt; + ssl_certificate_key /etc/nginx/conf.d/harbordomian.key; + + # Recommendations from https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html + ssl_protocols TLSv1.1 TLSv1.2; + ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; + ssl_prefer_server_ciphers on; + ssl_session_cache shared:SSL:10m; + + # disable any limits to avoid HTTP 413 for large image uploads + client_max_body_size 0; + + # required to avoid HTTP 411: see Issue #1486 (https://github.com/docker/docker/issues/1486) + chunked_transfer_encoding on; + + location / { + proxy_pass http://ui/; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_buffering off; + proxy_request_buffering off; + } + + location /v1/ { + return 404; + } + + location /v2/ { + proxy_pass http://registry/v2/; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_buffering off; + proxy_request_buffering off; + + } + + location /service/ { + proxy_pass http://ui/service/; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_buffering off; + proxy_request_buffering off; + } + } + server { + listen 80; + server_name harbordomian.com; + rewrite ^/(.*) https://$server_name$1 permanent; + } +}