Welcome! Log In Create A New Profile

Advanced

Re: Trouble adding /pma location to all virtual hosts

Ben Johnson
June 28, 2013 02:16PM
On 6/27/2013 7:13 PM, Francis Daly wrote:
> 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
>

Hi, Francis,

I've taken your good advice and swapped

location ~* /webmail {
return 301 /webmail/;
}

for

location = /webmail { return 301 /pma/; }
location = /WEBMAIL { return 301 /pma/; }
location = /WEBMAIL/ { return 301 /pma/; }

The latter form is simpler, its effect is obvious, and it seems less
prone to cause unexpected results if new locations are ever added.

On the whole, I've avoided top-level regex locations for the reason you
mentioned. Again, sound advice.

Everything else you say in your previous replies makes sense; you've
answered all of my questions (and then some!).

Excellent. Everything seems to be in good working order here.

Thanks again, Francis,

-Ben

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Trouble adding /pma location to all virtual hosts

Ben Johnson June 25, 2013 04:20PM

Re: Trouble adding /pma location to all virtual hosts

Ben Johnson June 26, 2013 10:24AM

Re: Trouble adding /pma location to all virtual hosts

Francis Daly June 26, 2013 05:34PM

Re: Trouble adding /pma location to all virtual hosts

Ben Johnson June 27, 2013 12:44PM

Re: Trouble adding /pma location to all virtual hosts

Ben Johnson June 27, 2013 12:56PM

Re: Trouble adding /pma location to all virtual hosts

Francis Daly June 27, 2013 07:10PM

Re: Trouble adding /pma location to all virtual hosts

Ben Johnson June 27, 2013 01:04PM

Re: Trouble adding /pma location to all virtual hosts

B.R. June 27, 2013 01:18PM

Re: Trouble adding /pma location to all virtual hosts

Ben Johnson June 27, 2013 02:10PM

Re: Trouble adding /pma location to all virtual hosts

B.R. June 27, 2013 03:10PM

Re: Trouble adding /pma location to all virtual hosts

Francis Daly June 27, 2013 07:14PM

Re: Trouble adding /pma location to all virtual hosts

Ben Johnson June 28, 2013 02:16PM

Re: Trouble adding /pma location to all virtual hosts

Francis Daly June 27, 2013 07:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 159
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready