Allow internal redirect to URI x, but deny external request for x?

2019-08-30 Thread J. Lewis Muir
Hello! I'm using nginx 1.12.2 on RHEL 7, and I've got a FastCGI web app that uses a deployment structure which uses an atomic symlink change for an atomic app deploy, and I'm wishing to be able to do an internal redirect in nginx to URL x, but deny an external request to the same URL x so that I

Re: Allow internal redirect to URI x, but deny external request for x?

2019-08-30 Thread J. Lewis Muir
On 08/30, J. Lewis Muir wrote: > I'm wondering if the fastcgi_split_path_info function or the if > directive is what's emitting the file op message in the error log which > would mean that one or both of $realpath_root or $fastcgi_script_name > are not set to what I expect. (?) Addi

Re: Allow internal redirect to URI x, but deny external request for x?

2019-08-30 Thread J. Lewis Muir
On 08/30, J. Lewis Muir wrote: > I initially tried using the alias directive which I thought was a better > fit for what I wanted to do > > location /my-app/ { > alias /srv/www/my-app/current/; > index index.php; > } > > location /my-app/

Re: Allow internal redirect to URI x, but deny external request for x?

2019-08-30 Thread J. Lewis Muir
On 08/30, J. Lewis Muir wrote: > On 08/30, J. Lewis Muir wrote: > > I'm wondering if the fastcgi_split_path_info function or the if > > directive is what's emitting the file op message in the error log which > > would mean that one or both of $realpath_root or $fastcgi_script

Re: Allow internal redirect to URI x, but deny external request for x?

2019-08-31 Thread J. Lewis Muir
On 08/31, Francis Daly wrote: > On Sat, Aug 31, 2019 at 12:21:40AM +0100, Francis Daly wrote: > > Hi there, > > A few further thoughts here... > > > It sounds like your desires are for requests: > > > > * starts with /my-app/current/ -> reject > > * starts with /my-app/releases/ -> reject >

Re: Allow internal redirect to URI x, but deny external request for x?

2019-08-31 Thread J. Lewis Muir
On 08/30, Ian Hobson wrote: > Hi Lewis, > > On 30/08/19 18:33, J. Lewis Muir wrote: > > Hello! > > > > I'm using nginx 1.12.2 on RHEL 7, and I've got a FastCGI web app that > > uses a deployment structure which uses an atomic symlink change for an >

Re: Allow internal redirect to URI x, but deny external request for x?

2019-08-31 Thread J. Lewis Muir
On 08/31, Francis Daly wrote: > On Fri, Aug 30, 2019 at 04:59:36PM -0500, J. Lewis Muir wrote: > > Hi there, > > > I was wishing for a way to specify a new root but with a modified > > request URI. So, I tried the alias directive, and I assumed that > > $document

Re: Allow internal redirect to URI x, but deny external request for x?

2019-08-30 Thread J. Lewis Muir
On 08/30, Francis Daly wrote: > On Fri, Aug 30, 2019 at 01:58:23PM -0500, J. Lewis Muir wrote: > > Hi there, > > > location ~ ^/my-app/(.*?[^/]\.php(?:/.*|$)) { > > alias /srv/www/my-app/current/$1; > > fastcgi_split_path_info ^(.+?\.php)(/.*)$; >

Re: Allow internal redirect to URI x, but deny external request for x?

2019-09-03 Thread J. Lewis Muir
On 09/02, Francis Daly wrote: > nginx does not "do" php. nginx does not care what your fastcgi server > will do with the key/value pairs that it sends. nginx cares that the > fastcgi server gives a valid response to the request that nginx makes. > > Typically, your fastcgi server will use the

Re: Allow internal redirect to URI x, but deny external request for x?

2019-09-03 Thread J. Lewis Muir
On 09/03, J. Lewis Muir wrote: > On 09/02, Francis Daly wrote: > > But if "the app" involves a http request to part1.php and then a http > > request to part2.php (or: a second http request to part1.php), I don't > > think that the symlink+realpath thing will preve

Re: Allow internal redirect to URI x, but deny external request for x?

2019-09-03 Thread J. Lewis Muir
On 08/30, j94305 wrote: > I've been following this, and I would take a slightly different approach. > > 1. Serve all apps under /{app}/releases/{version}/{path} as you have them > organized in the deployment structure in the file system. > > 2. Forget about symbolic links and other makeshift

Re: Allow internal redirect to URI x, but deny external request for x?

2019-08-31 Thread J. Lewis Muir
On 08/31, Francis Daly wrote: > On Sat, Aug 31, 2019 at 09:10:09AM -0500, J. Lewis Muir wrote: > > On 08/31, Francis Daly wrote: > > Hi there, > > > > * starts with /my-app/current/ -> reject > > > * starts with /my-app/releases/ -> reject &

Re: Allow internal redirect to URI x, but deny external request for x?

2019-09-04 Thread J. Lewis Muir
On 09/04, Jürgen Wagner (DVT) wrote: > This is the effect you get by having the HTTP equivalent of a symbolic link > in the NGINX (visible to the browser), not in the file system (which is > opaque to users). The file system link will (over time) serve different > contents under the same URL, so

Re: Allow internal redirect to URI x, but deny external request for x?

2019-09-04 Thread J. Lewis Muir
On 09/04, Jürgen Wagner (DVT) wrote: > Now, you want to be able to say what is the "current" version and reflect > this in the URL namespace as well. In the file system, that's a symbolic > link. In the URL namespace of NGINX, that could be a redirection (status > code 307). Both approaches would

Why 301 permanent redirect with appended slash?

2019-07-30 Thread J. Lewis Muir
Hello, all! I have a minimal nginx.conf with one server block that sets the root directory and one location with a prefix string of "/foo/", and for a request of "/foo", it returns a 301 permanent redirect to "/foo/". Why? I expected it to return 404 or similar. I also tried a prefix string of

Implicit root location?

2019-07-30 Thread J. Lewis Muir
Hello, all! I have a minimal nginx.conf with one server block that sets the root directory but has *no* location directives, yet for a request of "/", it serves "/index.html". Why? With no locations specified, I expected it to return 404 or similar for any request. Here's the server block

Re: Why 301 permanent redirect with appended slash?

2019-07-31 Thread J. Lewis Muir
On 07/31, Francis Daly wrote: > On Tue, Jul 30, 2019 at 05:12:01PM -0500, J. Lewis Muir wrote: > > Hi there, > > > I have a minimal nginx.conf with one server block that sets the root > > directory and one location with a prefix string of "/foo/", and for a

Re: RHEL Yum repo instructions don't work on RHEL 7

2019-10-02 Thread J. Lewis Muir
On 10/02, Konstantin Pavlov wrote: > Yep, that seems like the easiest solution. I've put Client, Workstation > and Server symlinks for respectable major releases to both stable and > mainline repos - I'd appreciate if you try again and let me know if that > fixes the issue for you. I confirm

RHEL Yum repo instructions don't work on RHEL 7

2019-10-01 Thread J. Lewis Muir
Hello! I'd like to report a problem with the RHEL/CentOS instructions at https://nginx.org/en/linux_packages.html#RHEL-CentOS They don't work on RHEL 7. When I attempt to install the nginx package as root with yum install nginx I get an HTTP 404 error:

Re: How to do location /test/place?id=2

2019-10-18 Thread J. Lewis Muir
On 10/18, P.V.Anthony wrote: > On 18/10/19 5:26 am, Jeff Dyke wrote: > > I know this is not an answer to your question, but it begs another, > > mainly due to the if statement.  How many of these are you going to > > have? https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ > > > >

Static content and Front Controller pattern under same base URI

2019-10-17 Thread J. Lewis Muir
Hello, nginxers! What's the best way to server static content as well as dynamic content that uses the Front Controller pattern under the same base URI? I'm dealing with a web app partially written in PHP that expects to serve static content as well as dynamic PHP content, using the Front

Re: IOS keep asking password with nginx auth_basic

2019-10-17 Thread J. Lewis Muir
On 10/17, tiendungitd wrote: > any idea about this issue? Are you serving over HTTPS? Are you positive that you are *not* serving any content over HTTP from HTTPS? Can you create an MCVE (minimal, complete, and verifiable example) for a ".txt" file over HTTP? For a ".txt" file over HTTPS? For

Re: How to do location /test/place?id=2

2019-10-17 Thread J. Lewis Muir
On 10/18, P.V.Anthony wrote: > Currently have the following url, > > https://old.example.com/test/place?id=1 > https://old.example.com/test/place?id=2 > https://old.example.com/test/place?id=3 > > Need to redirect only id=2 to another url. > > Did the following and it works for id=2. Need id=1

Re: PR_END_OF_FILE_ERROR after kernel update

2019-10-04 Thread J. Lewis Muir
On 10/04, Ken Wright wrote: > Okay, I rebooted the server then tried testing the cert.  SSL Labs > reports no secure protocols supported.  Once again, I'm lost.  I know I > set up the server to use LetsEncrypt certs, and I've checked them; > they're there.  I tried disabling the server's firewall