Welcome! Log In Create A New Profile

Advanced

most efficient way to return on everything but a single directory?

Jonathan Vanasco
November 07, 2016 08:16PM
I'm doing a quick audit on an nginx deployment and want to make sure something is implemented correctly

We have a handful of domains that redirect http traffic to https.

we used to do this, which is very efficient:

sever {
listen 80:
server_name example.com www.example.com;
return 301 https://www.example.com$request_uri;
}

now we use SSL certificates via letsencrypt, and need to keep a specific location on port 80 open to proxy into our custom renewal client.

the only thing I could think of was this:

sever {
listen 80:
server_name example.com www.example.com;

location /letsencrypt/ {
# proxy to client
}
location / {
return 301 https://www.example.com$request_uri;
}
}

Is there a more efficient way to accomplish the above or is the above the best way?



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

auth_basic within location block doesn't work when return is specified?

Scott McGillivray November 06, 2016 10:12AM

Re: auth_basic within location block doesn't work when return is specified?

Igor A. Ippolitov November 07, 2016 03:40AM

Re: auth_basic within location block doesn't work when return is specified?

Igor A. Ippolitov November 07, 2016 06:16AM

most efficient way to return on everything but a single directory?

Jonathan Vanasco November 07, 2016 08:16PM

Re: most efficient way to return on everything but a single directory?

Igor Sysoev November 07, 2016 11:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 281
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