Trouble adding /pma location to all virtual hosts

Francis Daly francis at daoine.org
Thu Jun 27 23:13:35 UTC 2013


On Thu, Jun 27, 2013 at 01:02:30PM -0400, Ben Johnson wrote:
> On 6/27/2013 12:42 PM, Ben Johnson wrote:

Hi there,

> > I don't want PMA (anything within the /pma/ location) to be accessible
> > over a plaintext connection. In other words, I wish to force HTTPS.

> location ^~ /pma/ {
>     root /var/www/;
> 
>     if ($scheme = http) {
>         return 301 https://$server_name$request_uri;
>     }
> 
>     # ...
> }
> 
> If there's a better way of achieving the same, I'd love to be informed.

The usual suggestion is that different server configurations best live
in different server blocks.

You have other reasons not to want to do that here -- including the
repetition aspect.

I'd say that what you have here is the best way.

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list