{"id":11,"date":"2014-12-16T09:48:07","date_gmt":"2014-12-16T09:48:07","guid":{"rendered":"http:\/\/edulab.unitn.it\/tecnici\/?p=11"},"modified":"2014-12-16T09:48:07","modified_gmt":"2014-12-16T09:48:07","slug":"wordpress-ssl-e-apache-reverse-proxy","status":"publish","type":"post","link":"https:\/\/edulab.unitn.it\/tecnici\/wordpress-ssl-e-apache-reverse-proxy\/","title":{"rendered":"WordPress, ssl e apache reverse proxy"},"content":{"rendered":"<p>\u00c8 possibile installare wordpress dietro un server apache che fa da reverse proxy.<\/p>\n<p>Basta aggiungere nel file\u00a0<em><span style=\"line-height: 1.42857143;\">\/etc\/apache2\/sites-enable\/default\u00a0<\/span><\/em><span style=\"line-height: 1.42857143;\"> del server esposto sulla rete le righe seguenti nella sezione\u00a0&lt;VirtualHost *:80&gt;<br \/>\n<\/span><\/p>\n<pre>ProxyPass \/Test\/ http:\/\/192.168.2.199\/\r\nProxyPassReverse \/Test\/ http:\/\/192.168.2.199\/<\/pre>\n<p>dove 192.168.2.199 \u00e8 il server interno che ospita il sito<\/p>\n<p>Se si vuole utilizzare una conessione sicura le righe sopra vanno aggiunte al file\u00a0\/etc\/apache2\/sites-enable\/default-ssl\u00a0del server esposto sulla rete le righe seguenti nella sezione\u00a0&lt;VirtualHost *:443&gt;<\/p>\n<p>Quello che succede per\u00f2 \u00e8 che la comunicazione tra in Proxy server e la macchina interna avviene tramite connessione non sicura.<\/p>\n<p>Se il sito \u00e8 fatto in wordpress quello che succede \u00e8 che wordpress non si accorge delle richieste in https ( che si fermano al server proxy&#8230;.) e quindi alcuni elementi delle pagine vengono esposti in http all&#8217;interno della pagina in https.<\/p>\n<p>Questa commistione di protocolli fa si che si legga in contenuto del sito ma che la &#8220;grafica&#8221; non funzioni.<\/p>\n<p>Per fare in modo che il sito funzioni bisogna istruire wordpress a rispondere sempre in https; per fare questo bisogna cambiare il siteurl e la home aggiungendo l&#8217;https e poi seguire le istruzioni al link<\/p>\n<p><a title=\"WordPress is_ssl() doesn\u2019t work behind some load balancers\" href=\"http:\/\/snippets.webaware.com.au\/snippets\/wordpress-is_ssl-doesnt-work-behind-some-load-balancers\/\" target=\"_blank\">http:\/\/snippets.webaware.com.au\/snippets\/wordpress-is_ssl-doesnt-work-behind-some-load-balancers\/<\/a><\/p>\n<p>aggiungendo il plugin al sito wordpress.<\/p>\n<p>In questo modo tutto il sito lavorer\u00e0 con https<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00c8 possibile installare wordpress dietro un server apache che fa da reverse proxy. Basta aggiungere nel file\u00a0\/etc\/apache2\/sites-enable\/default\u00a0 del server esposto sulla rete le righe seguenti nella sezione\u00a0&lt;VirtualHost *:80&gt; ProxyPass \/Test\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-11","post","type-post","status-publish","format-standard","hentry","category-how-to","category-web"],"_links":{"self":[{"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/posts\/11","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/comments?post=11"}],"version-history":[{"count":2,"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/posts\/11\/revisions"}],"predecessor-version":[{"id":13,"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/posts\/11\/revisions\/13"}],"wp:attachment":[{"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/media?parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/categories?post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edulab.unitn.it\/tecnici\/wp-json\/wp\/v2\/tags?post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}