Re: Can I rewrite https to http?

2023-08-15 Thread Ralph Seichter via nginx
* baalch...@gmail.com: > So, can I redirect the request, when user open https://nossl.abc.com, the > will be redirect to http://nossl.abc.com? While technically possible, you might find that connecting clients may interpret this as a "downgrade attack", because the client asked for an encrypted c

Re: Can I rewrite https to http?

2023-08-14 Thread Jore
Hi there, Hmm. I imagine this will be tricky to not run into infinite loops, if it's the behaviour of the browser to redirect a HTTP page to a HTTPS one. Wouldn't it just be easier to serve your site over HTTPS? Because in order to handle a redirect you'll need a valid TLS certificate anyway.

Can I rewrite https to http?

2023-08-14 Thread baalchina
Hi all, I had an nginx as a reserve proxy, with many web sites behind. And the nginx listen in 443(https) and 80(http). But not all my sites behind support https, so in some sites ,I only listen 80, like this: *server { listen 80; listen [::]:80; server_name nossl.ab

Re: Reverse proxying with URL Rewrite

2023-08-06 Thread Francis Daly
On Wed, Aug 02, 2023 at 01:42:46PM +0300, O G wrote: Hi there, > I would like to reverse proxy the following: > > https://test.us/citizensolutions/AB* to *https://*AB*.test.us/ and all the > subdirectories so that > all files like https://test.us/citizensolutions/AB/css/*.css reverse proxy > to

Reverse proxying with URL Rewrite

2023-08-02 Thread O G
Dear Community, I would like to reverse proxy the following: https://test.us/citizensolutions/AB* to *https://*AB*.test.us/ and all the subdirectories so that all files like https://test.us/citizensolutions/AB/css/*.css reverse proxy to https://*AB*.test.us/css/*.css AB in the above example can

Re: Mixing limit_except breaks rewrite functionality: workaround request

2023-07-10 Thread Francis Daly
On Mon, Jul 10, 2023 at 06:27:04AM +0200, Sten Grüner wrote: Hi there, > Got to do rewrites, since otherwise nginx breaks urlencoded query > parameters. Yes, that sounds like a good reason to not just use "the obvious" config. So -- following the example in the trac ticket that you linked,

Re: Mixing limit_except breaks rewrite functionality: workaround request

2023-07-09 Thread Sten Grüner
requests with somerewrite/proxy_pass logic. This mean that password is required only onPOST/PUT requests.This does not answer the question you asked, but is there a reason forthe "rewrite, rewrite, return, proxy_pass" sequence instead of justusing exactly "proxy_pass http://server:8081/

Re: Mixing limit_except breaks rewrite functionality: workaround request

2023-07-09 Thread Francis Daly
On Fri, Jun 30, 2023 at 11:29:21AM +0200, Sten Gruener wrote: Hi there, > I trying to mix authentication for POST requests with some > rewrite/proxy_pass logic. This mean that password is required only on > POST/PUT requests. This does not answer the question you asked, but is there

Mixing limit_except breaks rewrite functionality: workaround request

2023-06-30 Thread Sten Gruener
Dear all, I trying to mix authentication for POST requests with some rewrite/proxy_pass logic. This mean that password is required only on POST/PUT requests. location /x/ { limit_except GET OPTIONS { auth_basic "Write A

Re: Rewrite rules for Nginx

2022-11-12 Thread Sergey A. Osokin
Hi, hope you're doing well. On Wed, Nov 09, 2022 at 03:59:22PM -0500, Bumb1ebe wrote: > > I am just moving my website from apache to nginx. > > Unfortunately none of the online converters helped me with dealing the > htaccess migration to nginx rewrite rules. > >

Re: Rewrite rules not working

2022-11-11 Thread Francis Daly
On Fri, Nov 11, 2022 at 08:29:44AM -0500, blason wrote: Hi there, > By the way which one would you confirm is preferable method rewrite or > return? It depends, based on what you want to do. For what I think you want, in this case, "return" is simpler. f -- Francis

Re: Rewrite rules not working

2022-11-11 Thread blason
Thanks appreciate it. Will have to check and confirm. By the way which one would you confirm is preferable method rewrite or return? Posted at Nginx Forum: https://forum.nginx.org/read.php?2,295715,295725#msg-295725 ___ nginx mailing list -- nginx

Re: Rewrite rules not working

2022-11-11 Thread Francis Daly
On Thu, Nov 10, 2022 at 01:07:23PM -0500, blason wrote: Hi there, > I have a website http://web1.example.local/web1 > Instead I need a rewrite so that if user enters http://web1.example.local it > will be diverted to http://web1.example.local/web1 If you want it to happen, without need

Rewrite rules not working

2022-11-10 Thread blason
Hi Team, I am trying to write a below rewrite rule but somehow this is not working and I would really appreicate if someone can help me on this? I have a website http://web1.example.local/web1 Instead I need a rewrite so that if user enters http://web1.example.local it will be diverted to http

Rewrite rules for Nginx

2022-11-09 Thread Bumb1ebe
Hello I am just moving my website from apache to nginx. Unfortunately none of the online converters helped me with dealing the htaccess migration to nginx rewrite rules. Can someone help me with rewriting the correctly please? Options +FollowSymlinks RewriteEngine On ServerSignature Off

Re: Nginx rewrite issue

2022-02-20 Thread OS_Killer
Arguments from the requests are not taken into account when nginx choosing locations. Try to use the 'map' directive instead. For example: === map $arg_target $backend { 'server1' 'server1'; 'server2' 'server2'; default 'server1'; } server { listen 80; location = /index.html { proxy

Re: Nginx rewrite issue

2022-02-20 Thread Paul
On 2022-02-20 8:17 a.m., Dr_tux wrote: Hello, I want to write a rewrite like http://url/index.php?target=server1 and http://url/target=server1 in Nginx and I want to use it in reverse proxy. This is possible in AWS, but how can I do it in Nginx? I tried as follows. Not worked. location

Nginx rewrite issue

2022-02-20 Thread Dr_tux
Hello, I want to write a rewrite like http://url/index.php?target=server1 and http://url/target=server1 in Nginx and I want to use it in reverse proxy. This is possible in AWS, but how can I do it in Nginx? I tried as follows. Not worked. location = /index.html?target=server1 { proxy_pass

Question about rewrite in nginx.conf using a variable ?

2021-12-11 Thread Stephen D. Scotti, M.D.
I have a configuration for a Docker NGINX container that works OK with my 'static' configuration, but I’d like to maybe use a variable in the proxy rewrite to avoid have to duplicate a location block for the server. A sample Static setup with some of the extra stuff removed is s

Re: Rewrite/redirect issue

2021-05-07 Thread Francis Daly
On Thu, May 06, 2021 at 07:15:55PM +, Eric Speake wrote: Hi there, > Looking at the logs I see this: > > 192.168.250.30 - - [06/May/2021:13:27:27 -0500] "GET /summersummit HTTP/1.1" > 301 185 "-" > > While seeing the 301 it's not redirecting anywhere. What response do you get from somethi

RE: Rewrite/redirect issue

2021-05-06 Thread Eric Speake
Looking at the logs I see this: 192.168.250.30 - - [06/May/2021:13:27:27 -0500] "GET /summersummit HTTP/1.1" 301 185 "-" While seeing the 301 it's not redirecting anywhere. Thanks, From: nginx On Behalf Of Eric Speake Sent: Thursday, May 6, 2021 9:02 AM To: nginx@n

Re: Rewrite/redirect issue

2021-05-06 Thread James Read
nts/summersummit2021. Here is what I > have in my config: > > > >location /summersummit { > >return 301 > https://new.mydomain.com/events/employee-events/summersummit2021; > > } > > This one should work. > > > I have also tried: >

Re: Rewrite/redirect issue

2021-05-06 Thread Sergey A. Osokin
ation /summersummit { >return 301 > https://new.mydomain.com/events/employee-events/summersummit2021; >} This one should work. > I have also tried: > rewrite ^/summersummit/(.*)$ > https://new.dmp.com/events/employee-events/summersummit2021 permanent; > But the redirect do

Rewrite/redirect issue

2021-05-06 Thread Eric Speake
I am trying to redirect mydomain.com/summersummit to new.mydomain.com/events/employee-events/summersummit2021. Here is what I have in my config: location /summersummit { return 301 https://new.mydomain.com/events/employee-events/summersummit2021; } I have also tried: rewrite

Re: Rewrite with regex

2021-04-12 Thread Francis Daly
On Mon, Apr 12, 2021 at 03:01:12PM +0200, Artur wrote: > Le 12/04/2021 à 14:46, Francis Daly a écrit : Hi there, > > Does > > > > rewrite "^/([a-z][-a-z]{0,30}[a-z])$" ... > > > > do what you want in most cases? > > No, because it allows th

Re: Rewrite with regex

2021-04-12 Thread Artur
Le 12/04/2021 à 14:46, Francis Daly a écrit : > > Does > > rewrite "^/([a-z][-a-z]{0,30}[a-z])$" ... > > do what you want in most cases? No, because it allows these cases I don't want : - a-b - a---b---c---d By the way, the regex I sent before don'

Re: Rewrite with regex

2021-04-12 Thread Francis Daly
h. > But having several rewrite rules may be also a good idea. You had rewrite "^/([a-zA-Z0-9]{1,32})$" /index.php?short_name=$1 last; For brevity here, let's just use "lower case letter" instead of "letter or number", so effectively you had rewrite "

Re: Rewrite with regex

2021-04-12 Thread Artur
Le 12/04/2021 à 12:19, Francis Daly a écrit : > On Mon, Apr 12, 2021 at 12:02:32PM +0200, Artur wrote: > > Hi there, > >> This seems to work : >> >> rewrite "^/((?:[a-zA-Z0-9]+(?:[-][a-zA-Z0-9])*)+)$" >> /index.php?short_name=$1 last; >> >&g

Re: Rewrite with regex

2021-04-12 Thread Francis Daly
On Mon, Apr 12, 2021 at 12:02:32PM +0200, Artur wrote: Hi there, > This seems to work : > > rewrite "^/((?:[a-zA-Z0-9]+(?:[-][a-zA-Z0-9])*)+)$" > /index.php?short_name=$1 last; > > However, I suppose there is no way to check the size of $1 here. So far, it looks l

Re: Rewrite with regex

2021-04-12 Thread Artur
This seems to work : rewrite "^/((?:[a-zA-Z0-9]+(?:[-][a-zA-Z0-9])*)+)$" /index.php?short_name=$1 last; However, I suppose there is no way to check the size of $1 here. Le 12/04/2021 à 11:30, Artur a écrit : > Hello ! > > I have the following setup : > > location /

Rewrite with regex

2021-04-12 Thread Artur
Hello ! I have the following setup : location / {  try_files $uri $uri/ @shortnames; } location @shortnames {  rewrite "^/([a-zA-Z0-9]{1,32})$" /index.php?short_name=$1 last;  return 404; } I filter the 'shortnames' URI to have a format similar to /dfg6df4g64 with minimum an

Re: fastcgi_pass and caching with request rewrite

2020-10-15 Thread 0815
... } After adding this location in the fpm vhost the caching is not working as expected and delivers the same page for each request:    location ~ ^/hotel/([0-9]+)/.* {     rewrite ^/hotel/([0-9]+)/.* /index.php?id=3238&user_kuoniibefe_pi3[iff]=$1 break;    

fastcgi_pass and caching with request rewrite

2020-10-15 Thread 0815
... } After adding this location in the fpm vhost the caching is not working as expected and delivers the same page for each request: location ~ ^/hotel/([0-9]+)/.* { rewrite ^/hotel/([0-9]+)/.* /index.php?id=3238&user_kuoniibefe_pi3[iff]=$1 break;

Re: Rewrite .htaccess on nginx

2020-09-01 Thread Francis Daly
On Tue, Sep 01, 2020 at 03:34:33PM -0400, Jorge Enrique Diaz wrote: Hi there, > i want to do this in nginx > > Options All -Indexes > RewriteEngine on > > RewriteCond %{REQUEST_FILENAME} !-d > RewriteCond %{REQUEST_FILENAME} !-f > RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] That is approxima

Rewrite .htaccess on nginx

2020-09-01 Thread Jorge Enrique Diaz
fileon; #tcp_nopush on; autoindex off; autoindex off; location / { if (!-e $request_filename){ rewrite ^(.*)$ index.php?url=$1 break; } } #keepalive_timeout 0; keepa

Re: rewrite ssl proxy retain query string parms

2020-08-13 Thread Maxim Dounin
Hello! On Thu, Aug 13, 2020 at 06:57:59AM -0400, Mark Lybarger wrote: > I'm using rewrite to change some tokens in the url path, and am using ssl > proxy to send traffic to a downstream server. > > if i post to https://myhost/start/foo/213/hello, the request gets to > ht

rewrite ssl proxy retain query string parms

2020-08-13 Thread Mark Lybarger
I'm using rewrite to change some tokens in the url path, and am using ssl proxy to send traffic to a downstream server. if i post to https://myhost/start/foo/213/hello, the request gets to https://client-service-host/client/service/hello/213 using the needed certificate. great. my questi

Re: SSL and port number [was: Rewrite -- failure]

2020-04-29 Thread Francis Daly
On Tue, Apr 28, 2020 at 02:56:09PM -0400, Paul wrote: > On 2020-04-22 3:14 a.m., Francis Daly wrote: Hi there, > Thanks. I have the two sites "mostly" working now (full config below), but > could you please expand on your comment ""listen 8001 ssl;" means that nginx > will listen for https, so yo

Re: SSL and port number [was: Rewrite -- failure]

2020-04-29 Thread J.R.
To redirect a browser from http to https, you don't need to do an 'if' or 'rewrite'... The following would be the most efficient (and simplest)... server { listen 80; server_name myapps.example.com; access_log off; return 301

Re: SSL and port number [was: Rewrite -- failure]

2020-04-28 Thread Paul
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } server { if ($host = myapps.example.com) { return 301 https://$host$request_uri; } # managed by Certbot # automatically sets to https if someone comes in on http listen 80; listen 8084;

nginx reverse proxy rewrite rule

2020-04-27 Thread Johan Gabriel Medina Capois
Good afternoon How to make rewrite rule for nginx as reverse proxy for IIS backend Example We have a site configured https://dell.com but we want need when someone request https://dell.com the reverse proxy return dell.com/support/logon, how can we do it? Thank for your support Regards Johan

Re: rewrite and map ??interfering regexps

2020-04-26 Thread J.R.
> Until it is fixed, however, it would be extremely useful if, in the > description of the 'map' stanza it mentioned > that the regexp in 'map' can interfere with the regexp in a 'rewrite' > directive, in such a way that positional groups in the latter don

Re: rewrite and map ??interfering regexps

2020-04-26 Thread Norman Gray
Maxim, hello. On 26 Apr 2020, at 17:28, Maxim Dounin wrote: Relevant ticket is here: https://trac.nginx.org/nginx/ticket/564 Unfortunately, there is no obvious solution. On the other hand, this is something relatively easy to work around. Aha, so it _is_ the map regexp and the rewrite

Re: rewrite and map ??interfering regexps

2020-04-26 Thread Maxim Dounin
Hello! On Sun, Apr 26, 2020 at 01:49:19PM +0100, Norman Gray wrote: > Greetings. > > I'm trying to do some fairly intricate URI rewriting, and the behaviour of > the 'rewrite' statement does not correspond to anything I can explain from > the docs. > >

rewrite and map ??interfering regexps

2020-04-26 Thread Norman Gray
Greetings. I'm trying to do some fairly intricate URI rewriting, and the behaviour of the 'rewrite' statement does not correspond to anything I can explain from the docs. The goal is that /A/foo/modified is rewritten to /_newroot/foo and /B/foo/modified to /_defaultroot/

Re: SSL and port number [was: Rewrite -- failure]

2020-04-22 Thread Francis Daly
On Tue, Apr 21, 2020 at 07:09:41PM -0400, Paul wrote: Hi there, I confess I'm not quite certain what you are reporting here -- if you can say "with *this* config, I make *this* request and I get *this* response, but I want *that* response instead", it may be clearer. However, there is one thing

SSL and port number [was: Rewrite -- failure]

2020-04-21 Thread Paul
Thanks for your input. I have spent quite some time on this, and have failed on "rewrite". It all works using a different port number but *without* SSL -- the moment I add the Certbot back in (see config below) I get "Error code: SSL_ERROR_RX_RECORD_TOO_LONG". Also, sam

Re: Rewrite -- failure

2020-04-14 Thread Francis Daly
On Tue, Apr 14, 2020 at 04:38:51PM -0400, Paul wrote: Hi there, > My problem is that I need to split serv1.example.com to two physical servers > (both fully functional on LAN). The first (192.168.aaa.bbb) serving static > https works fine. But I cannot "rewrite" (redirect

Re: Rewrite -- failure

2020-04-14 Thread lists
nginx@nginx.org Subject: Rewrite -- failure New to this list (lurked for a couple of weeks), so hope you'll bear with me. I'm trying to get a charity's volunteers set up to work from home. Using nginx 1.14.0 (latest on Ubuntu 14.04LTS -- all up to date; #nginx -V below) as a front

Rewrite -- failure

2020-04-14 Thread Paul
pache 2.4. My problem is that I need to split serv1.example.com to two physical servers (both fully functional on LAN). The first (192.168.aaa.bbb) serving static https works fine. But I cannot "rewrite" (redirect, re-proxy?) to the second server (192.168.xxx.yyy, Perl cgi) where the

Re: rewrite rule with consistent document structure

2020-01-16 Thread J.R.
> I want to make it so that NGINX serves up the HTML and images from the > parent directory and omits the public directory from the URI. In your case, using "alias" would be the way to go... http://nginx.org/en/docs/http/ngx_http_core_module.html#alias

rewrite rule with consistent document structure

2020-01-16 Thread xrd
I have a directory containing several directories with the exact same structure. I'll be adding more and more directories with the exact same structure. I want to make an NGINX rewrite rule that makes the URL as simple as possible. For example, here is two of those directories. Notice each

RE: Location Rewrite Issue

2019-08-17 Thread Reinis Rozitis
> Thank you. That was indeed the issue. Now I can see the individual blog > entries at /blog/slug-of-blog > > but /blog and /blog/ urls are both throwing a 404. > > Is that an easy fix? > >> rewrite ^/blog/([A-Za-z0-9-]+)/?$ /blog-article.php?slug=$1 break;

Re: Location Rewrite Issue

2019-08-16 Thread Randy Johnson
e in a couple different places > but all it does is download the php file. > > > > location /blog { > > rewrite ^/blog/([A-Za-z0-9-]+)/?$ /blog-article.php?slug=$1 break; > > } > > Try to switch from 'break' to 'last'. > > By using 'brea

RE: Location Rewrite Issue

2019-08-16 Thread Reinis Rozitis
> I tried adding the following line in there in a couple different places but > all it does is download the php file. > > location /blog { > rewrite ^/blog/([A-Za-z0-9-]+)/?$ /blog-article.php?slug=$1 break; > } Try to switch from 'break' to 'last'. By u

Location Rewrite Issue

2019-08-15 Thread Randy Johnson
snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; } location @extensionless-php { rewrite ^(.*)$ $1.php last; } I tried adding the following line in there in a couple different places but all it does is download the php

Re: Cannot strip QS in rewrite

2019-06-21 Thread aquilinux
Hi Maxim, thanks for the rewrite_log hint. Actually it does rewrite as expected: 2019/06/21 12:35:37 [notice] 7495#7495: *4693835 "(?i)^/ambassadors$" > matches "/ambassadors", client: 1.1.1.1, server: www.example.co.uk, > request: "GET /ambassadors?test=1 HTTP

Re: Cannot strip QS in rewrite

2019-06-20 Thread Maxim Dounin
Hello! On Thu, Jun 20, 2019 at 05:05:57PM +0200, aquilinux wrote: > Hi guys, i've always used ? to strip QS in rewrites but i cannot get past > this odd issue i'm having: > > URL SOURCE: > > > https://www.example.co.uk/ambassadors?test=1 > > > R

Cannot strip QS in rewrite

2019-06-20 Thread aquilinux
Hi guys, i've always used ? to strip QS in rewrites but i cannot get past this odd issue i'm having: URL SOURCE: > https://www.example.co.uk/ambassadors?test=1 REWRITE: > rewrite (?i)^/ambassadors$ > https://www.example.com/uk-en/experience/ambassadors/? permanent; O

Re: args and rewrite vars always empty

2019-05-24 Thread User via nginx
#x27;m so stupid :) I generate my nginx hosts file with bash script and it execute this vars $1 at the generation time. Thank you for your time and help again. Maybe you can also suggest what is better for performance purposes: rewrite or try_files ? In my case I want only to make friendly SE

Re: args and rewrite vars always empty

2019-05-24 Thread Maxim Dounin
> configuration. Currently: There were no first line in your original message, hence the question. > server { >   listen SERVERIP:80; >   server_name domain.com; >   error_log  /var/log/nginx/domain.com.nginx notice; >   access_log off; >   rewrite_log on; >   index index

Re: args and rewrite vars always empty

2019-05-24 Thread User via nginx
inx/domain.com.nginx notice;   access_log off;   rewrite_log on;   index index.php;   root /home/user/domain.com;   location /product/ {    rewrite ^/product/(.*)/$ /$1/$2/$3/$0/end.txt last;   } } Look at this! My little investigation. I try to find where $1 is lost and for this purposes added other

Re: args and rewrite vars always empty

2019-05-24 Thread Maxim Dounin
Hello! On Fri, May 24, 2019 at 08:27:23AM +, User via nginx wrote: > Hello, > > I'm trying to make simple rewrite to work and found that $args and other > $1 vars from rewrite&try_files are always empty. > > nginx version: nginx/1.10.3 > > Server

Re: args and rewrite vars always empty

2019-05-24 Thread User via nginx
On 5/24/19 8:41 AM, Patrick wrote: > Use 'break' instead of 'last' as per > > https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite Unfortunately, it did not help. A small addition. Only try_files lose $args, rewrite show args at error_logs with f

Re: args and rewrite vars always empty

2019-05-24 Thread Patrick
On 2019-05-24 08:27, User via nginx wrote: > I'm trying to make simple rewrite to work and found that $args and other > $1 vars from rewrite&try_files are always empty. > >   location /product/ { >     rewrite ^/product/(.*)/$ /$1.txt last; >   } Use 'break&

args and rewrite vars always empty

2019-05-24 Thread User via nginx
Hello, I'm trying to make simple rewrite to work and found that $args and other $1 vars from rewrite&try_files are always empty. nginx version: nginx/1.10.3 Server config:   location /product/ {     rewrite ^/product/(.*)/$ /$1.txt last;    #    try_files $uri/ /test.php?test=$uri

Re: rewrite hostname in sub_filter!

2019-05-12 Thread shahzaib mushtaq
Will very much appreciate if someone can help on it. On Sun, May 12, 2019 at 5:33 PM shahzaib mushtaq wrote: > Hi, > > I am able to achieve this by writing the following rule which creates a > new variable with domain mydomain-com. > > if ($host ~* "(\w+)[-.](\w+)") { > set $host_new "$1-$

Re: rewrite hostname in sub_filter!

2019-05-12 Thread shahzaib mushtaq
Hi, I am able to achieve this by writing the following rule which creates a new variable with domain mydomain-com. if ($host ~* "(\w+)[-.](\w+)") { set $host_new "$1-$2"; } However, its not working for any subdomain like work.mydomain.com , i tried following configs to cover subdomains

rewrite hostname in sub_filter!

2019-05-12 Thread shahzaib mushtaq
Hi, We've running nginx as reverse proxy for backend domain named "mydomain.com". On proxy server we've setup vhost that covers domain and all subdomains *. mydomain.com. What we need is that if user request to any subdomain like work.mydomain.com, he should be proxied to single backend mydomain.

Re: Advanced Rewrite request url to match the query string and normalization

2019-03-03 Thread Francis Daly
On Tue, Feb 26, 2019 at 11:07:34PM -0500, shadowgun1102 wrote: Hi there, > I have a simple nginx forward proxy, configured as: nginx is not a forward proxy, and therefore there will be "rough edges" when you try to use it as such. That's fine, so long as you know. > The client behind its isp fi

RE: Rewrite does not work

2019-02-28 Thread Reinis Rozitis
> > I've added the following rewrite line in the Config website: > > rewrite ^tagged\/(.*)$ /?p=blog&blog_tag_name=$1 break; > > It is supposedly called by the following URL: /tagged/Server be redirected to > the > following internally: /blog?blog_name=&

Rewrite does not work

2019-02-28 Thread necromonger
Hello forum members, I have the following problem and I hope someone can help me. I've added the following rewrite line in the Config website: rewrite ^tagged\/(.*)$ /?p=blog&blog_tag_name=$1 break; It is supposedly called by the following URL: /tagged/Server be redirected to the

Advanced Rewrite request url to match the query string and normalization

2019-02-26 Thread shadowgun1102
I have a simple nginx forward proxy, configured as: server { listen 8000; resolver 8.8.8.8; location / { proxy_pass http://$host; proxy_set_header Host $host; } } The client behind its isp firewall sends the request (per nginx log): GET http://www.clientisp.com/path/rewrite.do?url=http%3A%2F%2Fww

Re: Rewrite doesn't work if location has no trailing /

2019-02-09 Thread reibuehl
I added a rewrite rule to permanently redirect /webmail to /webmail/ and it works fine! Many thanks for the quick help! Posted at Nginx Forum: https://forum.nginx.org/read.php?2,282962,282964#msg-282964 ___ nginx mailing list nginx@nginx.org http

Re: Rewrite doesn't work if location has no trailing /

2019-02-09 Thread nanaya
Hi, On Sat, Feb 9, 2019, at 19:50, Reiner Bühl wrote: > Hi all, > > I currently use the following location to redirect every request for a > resource under /webmail to a seperate server: > > location /webmail { > rewrite ^/

Rewrite doesn't work if location has no trailing /

2019-02-09 Thread Reiner Bühl
Hi all, I currently use the following location to redirect every request for a resource under /webmail to a seperate server: location /webmail { rewrite ^/webmail(.*) /$1 break; proxy_pass http://127.0.0.1:8081; proxy_redirect off

Re: rewrite nginx !

2018-12-12 Thread shahzaib mushtaq
Ok, this worked : rewrite ^/videos/([0-9]+)/(.*)/(.*)/(.*)/([0-9]+)? https://domain.com/videos/$1/$2 last; However, if there's any better rule, please let me know. Regards. On Wed, Dec 12, 2018 at 3:01 PM shahzaib mushtaq wrote: > Hi, > > Need help on constructing the rewrit

rewrite nginx !

2018-12-12 Thread shahzaib mushtaq
Hi, Need help on constructing the rewrite url in nginx, need to remove last two parts of uri as stated in example below: https://domain.com/videos/32/cooking/most_recent/last_year/ to https://domain.com/videos/32/cooking https://domain.com/videos/17/tv-showbiz/most_recent/today/ to https

Re: Strange behaviour of %27 encoding in rewrite

2018-11-19 Thread aquilinux
Thanks Maxim, using the return directive worked flawlessly. Regards, On Thu, Nov 15, 2018 at 4:55 PM Maxim Dounin wrote: > Hello! > > On Wed, Nov 14, 2018 at 03:54:20PM +0100, aquilinux wrote: > > > Hi all, > > i'm seeing a strange behaviour in nginx rewrite

Re: Strange behaviour of %27 encoding in rewrite

2018-11-15 Thread Maxim Dounin
Hello! On Wed, Nov 14, 2018 at 03:54:20PM +0100, aquilinux wrote: > Hi all, > i'm seeing a strange behaviour in nginx rewrite involving encoded urls for > *%27* > I have this type of rewrite: > > rewrite "^/brands/l-oreal$" > > https://somedomain.tld/L%2

Strange behaviour of %27 encoding in rewrite

2018-11-14 Thread aquilinux
Hi all, i'm seeing a strange behaviour in nginx rewrite involving encoded urls for *%27* I have this type of rewrite: rewrite "^/brands/l-oreal$" > https://somedomain.tld/L%27Or%C3%A9al-Paris/index.html? permanent; > That translates to this: > [~]> curl -kIL ht

Rewrite request url to match the query string and normalization

2018-11-11 Thread Jindan Zhou
I have a simple nginx forward proxy, configured as: server { listen 8000; resolver 8.8.8.8; location / { proxy_pass http://$host; proxy_set_header Host $host; } } The client behind its isp firewall sends the requ

Re: [IE] Re: Rewrite with number after hyphen

2018-09-05 Thread Ivan Bianchi
me other inspection on the result and > see exactly what is triggering. This has saved my bacon more than once J. > > > > Jason > > > > > > > > location /foo { > > > rewrite /foo/(.*) /web/foo.do?a=$1 last; > > > } > > *From:* nginx

RE: [IE] Re: Rewrite with number after hyphen

2018-09-05 Thread Jason Whittington
what is triggering. This has saved my bacon more than once ☺. Jason > > location /foo { > > rewrite /foo/(.*) /web/foo.do?a=$1 last; > > } From: nginx [mailto:nginx-boun...@nginx.org] On Behalf Of Ivan Bianchi Sent: Wednesday, September 5, 2018 9:25 AM To: nginx@nginx.or

Re: Rewrite with number after hyphen

2018-09-05 Thread Ivan Bianchi
Hi there, > > > > location /foo { > > > rewrite /foo/(.*) /web/foo.do?a=$1 last; > > > } > > This seems to work as expected for me, using nginx/1.14.0. > > > KO: > > > > > https://www.test.com/foo/asdf-12 > > Why do you think it does not work? What

Re: Rewrite with number after hyphen

2018-09-03 Thread Francis Daly
On Mon, Sep 03, 2018 at 08:13:11AM +0200, Ivan Bianchi wrote: Hi there, > > location /foo { > > rewrite /foo/(.*) /web/foo.do?a=$1 last; > > } This seems to work as expected for me, using nginx/1.14.0. > KO: > > > https://www.test.com/foo/asdf-12 Why do you t

Rewrite with number after hyphen

2018-09-02 Thread Ivan Bianchi
Hi, I detected an issue with my rewrite rule in the nginx.conf and I don't understand why it happens and how to fix it. I have tested in two environments with versions 1.10.3 and 1.14.0. Having the following simple conf with a regex is intended to get everything: > location /foo { &

Re: rewrite rule: MediaWiki to static site

2018-08-20 Thread Jeff Dyke
a map. We will add more to static and more to Play overtime, as we already have, and this keeps on chugging. Best, Jeff On Mon, Aug 20, 2018 at 4:10 PM petecooper wrote: > Francis Daly Wrote: > > > In this case, it looks to me that you can probably "return" rather > >

Re: rewrite rule: MediaWiki to static site

2018-08-20 Thread petecooper
Francis Daly Wrote: > In this case, it looks to me that you can probably "return" rather > than > "rewrite", since everything should probably be a http redirect. > non-Mediawiki URL > [...] Except I would have the config be not a lot more than > >

Re: rewrite rule: MediaWiki to static site

2018-08-20 Thread Francis Daly
On Mon, Aug 20, 2018 at 06:09:10AM -0400, petecooper wrote: Hi there, > I'm diverting traffic from an retired MediaWiki site to an active static > site. I'm somewhat confused with the process of `rewrite`-ing old URLs with > a query string to standard URLs *without* a query s

rewrite rule: MediaWiki to static site

2018-08-20 Thread petecooper
Hello. I'm diverting traffic from an retired MediaWiki site to an active static site. I'm somewhat confused with the process of `rewrite`-ing old URLs with a query string to standard URLs *without* a query string on the static site. For clarity, I do not need or want query strings on th

Re: rewrite question

2018-06-12 Thread shiz
'if ($args ~ "&$") { return 400; }' Thanks a lot! Exactly what I needed :) Posted at Nginx Forum: https://forum.nginx.org/read.php?2,94128,280124#msg-280124 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Re: rewrite question

2018-06-11 Thread Richard Stanway via nginx
obots.txt > > > > e.g. page.php?page=aaa -> page.php?page=aaa& > > > > Any idea how to redirect/rewrite this? > > Untested, but: > > if ($args ~ "&$") { return 400; } > > should handle all requests that end in the four c

Re: rewrite question

2018-06-11 Thread Francis Daly
mp; > > Any idea how to redirect/rewrite this? Untested, but: if ($args ~ "&$") { return 400; } should handle all requests that end in the four characters you report. You may prefer a different response code. Good luck with it,

Re: rewrite question

2018-06-11 Thread shiz
'The & to & conversion is another sign of a poor quality crawler.' I wasn't referring to any of them but to '&'. Important difference. Also explaining my failure to filter it from parameters since parameters contains an equal sign. E.g. ...&= something or even &= & or & would also easy do filt

Re: rewrite question

2018-06-11 Thread shiz
ng at network level.` My actual reply: 1 - It is Google 2 - They do not always a user friendly user agent. That is a fact. 3 - When they don't, they also don't follow robots.txt. So my problem remains. I don't want to block those IP ranges at iptables level because it's

Re: rewrite question

2018-06-11 Thread Richard Stanway via nginx
wrote: > Hi, > > Recently, Google has started spidering my website and in addition to normal > pages, appended "&" to all urls, even the pages excluded by robots.txt > > e.g. page.php?page=aaa -> page.php?page=aaa& > > Any idea how to redirect/rewrite this? >

rewrite question

2018-06-07 Thread shiz
Hi, Recently, Google has started spidering my website and in addition to normal pages, appended "&" to all urls, even the pages excluded by robots.txt e.g. page.php?page=aaa -> page.php?page=aaa& Any idea how to redirect/rewrite this? Posted at Nginx Forum: https://for

Re: Rewrite mirrored request

2018-05-30 Thread Jurian Broertjes
lr/abc/select?xyz If the only reason why you need this rewrite is proxy_pass, then just pass it a modified uri. map $request_uri $new_uri { ~^/prd-solr/(.*)$ /solr/$1; } location /mirror { internal; proxy_pass http://cloud$new_uri; } Best regards, Jurian On 28-05-18 17:50, Roman A

Re: Rewrite mirrored request

2018-05-29 Thread Roman Arutyunyan
t?xyz, so I would expect the > "prd-solr" part to be rewritten for the mirror requests. The log says: > > "GET /prd-solr/abc/select?xyz HTTP/1.0 > Host: cloud > > Do you have a suggestion on how to get it to "/solr/abc/select?xyz If the only reason why you need

  1   2   3   4   5   6   >