upstream registry {
server 172.17.0.1:5000;
}
server {
listen 80;
server_name registry.yourdomain.com;
return 301 https://registry.yourdomain.com$request_uri;
}
server {
listen 443 ssl;
server_name registry.yourdomain.com;
gzip on;
ssl_certificate /your_ssl_path/registry.yourdomain.com.crt;
ssl_certificate_key /your_ssl_path/registry.yourdomain.com.key;
location / {
proxy_redirect off;
proxy_pass http://registry;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
client_max_body_size 100m;
client_body_buffer_size 128k;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}
|