Mam VPS'a a na nim zainstalowany i działajcy SSL, problem pojawił się kiedy odpaliłęm DOCKER w którym mam uruchomiony serwer do przetwarzania zdjęć,
resize, crop, fill według zadanych parametrów.
I nie powiem,działa bardzo dobrze ale tylko po http, nie mogę sobie poradzić a próbowałem już chyba wszystkiego. Przeczytałem trochę na temat PROXY, próbowałem poustawiać w/g
proponowanych wzorców ale to za diabła nie działa.
system: CentOS 7..., httpd 2.4 (Apache2.4), OpenSSL oczywiście i utknałem ....
nie rozumiem do końca jak działa Proxy w takim przypadku.
konfiguracja serwera VPS:
<VirtualHost *:80> # Redirect any HTTP request to HTTPS RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L] ServerAdmin root@imgproxy.mojserver.net DocumentRoot /var/www/html/imgproxy ServerName imgproxy.mojserver.net </VirtualHost> # Virtual Host 1 <VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/pki/tls/certs/ca.crt SSLCertificateKeyFile /etc/pki/tls/private/ca.key <Directory /var/www/html/imgproxy> AllowOverride All </Directory> ServerAdmin root@imgproxy.mojserver.net DocumentRoot /var/www/html/imgproxy ServerName imgproxy.mojserver.net </VirtualHost>
jak dotad wszystko działa.
Poniżej to co ustawiłem dla proxy(osobny plik proxy.conf):
# HTTP <VirtualHost *:80> ServerName imgproxy.mojserver.net ServerAlias imgproxy.mojserver.net www.imgproxy.mojserver.net # Redirect any HTTP request to HTTPS RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L] # Logging LogLevel warn ErrorLog imgproxy.mojserver.net-error_log CustomLog imgproxy.mojserver.net-access_log combined </VirtualHost> # HTTPS <VirtualHost *:443> ServerName imgproxy.mojserver.net # Logging LogLevel warn ErrorLog imgproxy.mojserver.net-error_log CustomLog imgproxy.mojserver.net-access_log combined # SSL Configuration - uses strong cipher list - these might need to be downgraded if you need to support older browsers/devices SSLEngine on SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH SSLProtocol All -SSLv2 -SSLv3 # -TLSv1 -TLSv1.1 SSLHonorCipherOrder On SSLCertificateFile /etc/pki/tls/certs/ca.crt SSLCertificateKeyFile /etc/pki/tls/private/ca.key #SSLCertificateChainFile /path/to/your/certificate/chainfile.crt # HSTS (optional) Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;" # Remove this if you need to use frames or iframes # Header always set X-Frame-Options DENY # Prevent MIME based attacks Header set X-Content-Type-Options "nosniff" # Reverse proxy configuration < Location / > ProxyPass imgproxy.mojserver.net/ ProxyPassReverse imgproxy.mojserver.net:8080/ < /Location > </VirtualHost>
Co źle zrobiłem, może mi to ktoś objaśnić i wskazać jak powinienem to zrobić ,żeby kontenery także były "secure"?
Czy może trzeba zainstalować certyfikat również na kontenerze ?
Jeśli tak to jak się do tego zabrać ?
Doker niby temat nie nowy ale dla mnie .... bardzo.
Pozdrawiam
phpamator