<div dir="ltr"><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Tue, Feb 16, 2016 at 1:14 PM, Miguel C <span dir="ltr"><<a href="mailto:miguelmclara@gmail.com" target="_blank">miguelmclara@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">I have similar setups with freebsd jails... usually one the jails is a 'frontend proxy server' which I'm guessing is what you're aiming at but with linux containers....<br><br>Make sure the firewall allow traffic from the frontend to backends which could be other nginx servers or just php-fpm it self depending on the setup, but all you really need is to use proxy_pass.<br><br>Since you want HTTPS you need to have the certificates config in the frontend, regardless if the connection to the backends is also encrypted or not.<br><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">A simple example assuming one VM(LXC) as php-fpm running you could just setup the frontend as you would normally do just use:<br><br>fastcgi_pass CONTAINER_IP:FPM_PORT<br><br><br>Another scenario is ofc you have nginx running in the LXC container which is already "fastcgi_passing" to php, in this case you would use proxy_pass to the backend niginx, IE:<br><br><div class="gmail_extra">server {</div><div class="gmail_extra">        listen          IP:443;</div><div class="gmail_extra">        server_name    <a href="http://expemple.org" target="_blank">expemple.org</a>;</div><div class="gmail_extra"><br></div><div class="gmail_extra">        ssl on;</div><div class="gmail_extra">        ssl_certificate /usr/local/etc/nginx/ssl/site.crt;</div><div class="gmail_extra">        ssl_certificate_key /usr/local/etc/nginx/ssl/site.key;</div><div class="gmail_extra"><br></div><div class="gmail_extra">        location / {</div><div class="gmail_extra">                proxy_pass <a href="http://lxc_nginx" target="_blank">http://lxc_nginx</a>;</div><div class="gmail_extra">        }</div><div class="gmail_extra">}</div><div class="gmail_extra"><br></div><div class="gmail_extra">upstream lxc_nginx {</div><div class="gmail_extra">        server <a href="http://10.221.186.23:80" target="_blank">10.221.186.23:80</a>; <<<< --- Note that in this case the connection from frontend to the nginx container is not encrypted, but you can use 443 here as long as the backup as the proper ssl config (ssl_certificate and key)</div><div class="gmail_extra">}</div><div><br></div><div><div><div dir="ltr"><div><div>NOTE: <a href="http://10.221.186.23/" target="_blank" rel="noreferrer">10.221.186.23:80</a>; is ofc an example IP (you're container IP)</div></div></div></div></div></div></div></blockquote></div></div></div>