<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body style="background-color: rgb(255, 255, 255); color: rgb(0, 0,
0);" bgcolor="#FFFFFF" text="#000000">
If I understand what you're trying to do correctly, then I think you
want something like:<br>
<pre wrap=""># Ensure no tailing slashes
rewrite ^/(.*)/$ /$1 permanent;
location @upstream {
proxy_pass https://xxxx:xportNumber;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
proxy_redirect off;
}
</pre>
<pre wrap="">location / {
try_files $uri $uri/ @upstream;
}</pre>
This will accept /wibble/ and rewrite it to /wibble (this will be
passed back to the client which will then re-request /wibble) when
the new request rewritten comes it the server will still look for
local matches of /wibble (the file) and /wibble/<index files>
(the directory) when searching for the content to serve and if not
found will pass the request to your upstream server.<br>
<br>
Regards<br>
Steve<br>
<br>
<div class="moz-cite-prefix">On 28/04/2017 15:48, Alex Med wrote:<br>
</div>
<blockquote
cite="mid:15175a622a4a02ef3ae3a207d373c423.NginxMailingListEnglish@forum.nginx.org"
type="cite">
<pre wrap="">Steveh:
Thank you for your reply.
So what you are suggesting me to do is something like this:
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/(.*)/$ /$1 permanent;
}
Put try files inside the location block and create a new block with the
rewrite?
Thank you for the clarification!
Posted at Nginx Forum: <a class="moz-txt-link-freetext" href="https://forum.nginx.org/read.php?2,273964,273966#msg-273966">https://forum.nginx.org/read.php?2,273964,273966#msg-273966</a>
_______________________________________________
nginx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:nginx@nginx.org">nginx@nginx.org</a>
<a class="moz-txt-link-freetext" href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a>
</pre>
</blockquote>
<br>
</body>
</html>