On 31/01/2020 12:37, Reinis Rozitis wrote:
if ($arg_p) {
return 301http://yoursite/p/$arg_p;
}
This is what I was originally looking for, however as I've only 20 pages
to manage the individual redirects via the map directive I believe will
work better as it will remove a additional r
On Fri, Jan 31, 2020 at 12:11:54PM +, Steve Wilson wrote:
Hi there,
> Hugo's alias basically creates a /alias/index.html file which contains a
> meta refresh.
Ah, ok. Presumably there would have to be some web server config
needed to make the incoming request actually serve that file --
I th
>
> if ($args ~ "^p=(\d+)") {
> set $page $1;
> set $args "";
> rewrite ^.*$ /p/$page last;
> break;
> }
>
> I knew there'd be a simpler way and I due to the time
Hugo's alias basically creates a /alias/index.html file which contains a
meta refresh. I managed to find something using an if which does the
job, however using the map solution presented is much more elegant as it
would reduce the redirects.
if ($args ~ "^p=(\d+)") {
On Fri, Jan 31, 2020 at 01:13:30AM +, Steve Wilson wrote:
Hi there,
> Currently wordpress is using ugly urls for posts, so "/?p=1234" in wordpress
> might be "/this_nice_title" in hugo.
> Now hugo allows me to specify aliases too which I'd like to leverage to
> maintain links, but this is whe
I'm currently in the process of transitioning from wordpress to hugo.
For anyone not familiar with these, wordpress is php based and hugo
outputs static content (keeping it simple)
Currently wordpress is using ugly urls for posts, so "/?p=1234" in
wordpress might be "/this_nice_title" in hugo.
N
On Sun, Dec 29, 2019 at 04:41:58AM -0500, Olaf van der Spek wrote:
Hi there,
> > rewrite ^(.*)$ $1?ra=$remote_addr break;
>
> The ra argument is inserted before the original query string. Is it possible
> to append it to the original query string?
Something like
rewrite ^(.*)$ $1?$args&ra=$r
Hi Olaf,
hope you're doing well.
On Sun, Dec 29, 2019 at 04:41:58AM -0500, Olaf van der Spek wrote:
> > rewrite ^(.*)$ $1?ra=$remote_addr break;
>
> The ra argument is inserted before the original query string. Is it possible
> to append it to the original query string?
> Is this behavior docume
> rewrite ^(.*)$ $1?ra=$remote_addr break;
The ra argument is inserted before the original query string. Is it possible
to append it to the original query string?
Is this behavior documented somewhere? Couldn't find it.
Can one also remove certain arguments from the query string this way?
Posted
Am 12.09.2019 um 08:08 schrieb Zeeshan Opel:
> I am trying to rewrite a url in nginx.
>
> When i am accessing mail.parco.net.pk in browser, it
> opens below link:
>
> http://mailsvr.parco.net.pk/mailsvr/mail/mailbox.nsf
> But in actual it should open http://mailsvr.parco.net.pk/mail/mailbox.nsf
Please help
On Thu, Sep 12, 2019 at 11:08 AM Zeeshan Opel wrote:
> I am trying to rewrite a url in nginx.
>
> When i am accessing mail.parco.net.pk in browser, it opens below link:
>
> http://mailsvr.parco.net.pk/mailsvr/mail/mailbox.nsf
> But in actual it should open http://mailsvr.parco.net.p
I am trying to rewrite a url in nginx.
When i am accessing mail.parco.net.pk in browser, it opens below link:
http://mailsvr.parco.net.pk/mailsvr/mail/mailbox.nsf
But in actual it should open http://mailsvr.parco.net.pk/mail/mailbox.nsf
Below is my nginx conf file.
worker_processes 1;
worker_
t 17.37
> To: "nginx@nginx.org"
> Subject: Re: URL-Rewriting not working
>
> Hi Francis.
>
> On Sun, Apr 9, 2017 at 8:47 PM, Francis Daly wrote:
>
>> On Sun, Apr 09, 2017 at 06:36:51PM +0530, Ajay Garg wrote:
>
-boun...@nginx.org>> on behalf
of Ajay Garg mailto:ajaygargn...@gmail.com>>
Reply-To: "nginx@nginx.org<mailto:nginx@nginx.org>"
mailto:nginx@nginx.org>>
Date: Sunday, 9 April 2017 at 17.37
To: "nginx@nginx.org<mailto:nginx@nginx.org>"
mailto:nginx@nginx.o
Hi Francis.
On Sun, Apr 9, 2017 at 8:47 PM, Francis Daly wrote:
> On Sun, Apr 09, 2017 at 06:36:51PM +0530, Ajay Garg wrote:
>
> Hi there,
>
> > Got it Francis !!
>
> Good news.
>
> > location / {
> > auth_basic 'Restricted';
> >
On Sun, Apr 09, 2017 at 06:36:51PM +0530, Ajay Garg wrote:
Hi there,
> Got it Francis !!
Good news.
> location / {
> auth_basic 'Restricted';
> auth_basic_user_file
> /home/20da689b45c84f2b80bc84d651
Got it Francis !!
server {
listen 2001 ssl;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
location / {
auth_basic 'Restricted';
Hi Francis.
Thanks a ton for your suggestions.
On Sun, Apr 9, 2017 at 5:58 PM, Francis Daly wrote:
> On Sun, Apr 09, 2017 at 05:27:31PM +0530, Ajay Garg wrote:
>
> Hi there,
>
> > Unfortunately, our backen-service(s) (on port 2000 in the example) is
> > ssh-reverse-tunnel, having two layers of
On Sun, Apr 09, 2017 at 05:27:31PM +0530, Ajay Garg wrote:
Hi there,
> Unfortunately, our backen-service(s) (on port 2000 in the example) is
> ssh-reverse-tunnel, having two layers of machines behind them. The
> terminating-node for sure cannot be changed.
"In general", reverse-proxying to a dif
30, Ajay Garg wrote:
>
> Hi there,
>
> > However, I am not able to do the proxying if I perform url-rewriting.
> > Nothing of the following works ::
>
> Note that if you want to reverse-proxy a back-end web service at a
> different part of the url hierarchy to where it
On Sat, Apr 08, 2017 at 06:39:59PM +0530, Ajay Garg wrote:
Hi there,
> However, I am not able to do the proxying if I perform url-rewriting.
> Nothing of the following works ::
Note that if you want to reverse-proxy a back-end web service at a
different part of the url hierarchy to wh
listen 2001;
>>>> location / {
>>>>
>>>> auth_basic 'Restricted';
>>>> auth_basic_user_file
>>>> /home/2819163155b64c4c81f8608aa23c9faa/.h
'Restricted';
>>> auth_basic_user_file
>>> /home/2819163155b64c4c81f8608aa23c9faa/.htpasswd;
>>> proxy_pass http://127.0.0.1:2000;
>>> }
>>> }
>>>
>>> #
>>
auth_basic_user_file
>> /home/2819163155b64c4c81f8608aa23c9faa/.htpasswd;
>> proxy_pass http://127.0.0.1:2000;
>> }
>> }
>> ####
>&
> auth_basic_user_file /home/
> 2819163155b64c4c81f8608aa23c9faa/.htpasswd;
> proxy_pass http://127.0.0.1:2000;
> }
> }
>
> #
>
>
>
> H
0.0.1:2000;
}
}
#
However, I am not able to do the proxying if I perform url-rewriting.
Nothing of the following works ::
a)
server {
listen 2001;
lo
Hi, everyone!
I would like to know if there's a simple way to have Nginx rewrite a
"multipart/form-data" request to a "x-www-form-urlencoded" request with
only a (binary) file as the content.
That is, I want the rewritten request to look like it was produced with the
Curl --data-binary option.
T
I think this seems to be working for now. Does anyone see a problem with
it:
# define web root
root /var/www/html/public;
index index.php default.php index.html;
location / {
try_files $uri $uri/ =404;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_in
If I followed your post correctly, you wanted me to make a map of locations.
However, I want the users to be able to add a new directory (ex:
/var/www/c/foo) and have a url like 'http://xxx/c/foo/index.php/users/login'
automatically served by /var/www/c/foo/index.php without having to change
Nginx
setup url rewriting so that any request to
http://xxx/a/foo/index.php/users/login gets redirected to
http://xxx/a/foo/index.php and similarly
http://xxx/a/bar/index.php/users/login gets redirected to
http://xxx/a/bar/index.php
I may have a large number of applications in the sub directories s
Did you mean to use nested location blocks? I tried it but it didn't work.
Here is the relevant part of my configuration file:
# define web root
root /var/www/html/public;
index index.php index.html;
location /index.php {
location ~* (?:.*/index.php)(.*) {
fa
Hello,
You do not necessarily need to *redirect* *per se*, but you wish content to
be served by your index.php files.
Would
location /index.php {
location ~* (?:.*/index.php)(.*) {
fastcgi_param SCRIPT_FILENAME $document_root$1;
fastcgi_pass ;
}
}
do the job? (untested)
--
Another note, on some of the application sub directories, I need to emulate
this rule from .htaccess: RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/index.php/$1
[QSA,L]
Posted at Nginx Forum:
https://forum.nginx.org/read.php?2,263024,263026#msg-263026
___
nginx
I have a single Nginx installation and I am using PHP-FPM to serve multiple
PHP applications in sub directories. Example:
/var/www/ (this is 'root')
/var/www/a/foo/index.php
/var/www/a/bar/index.php
/var/www/b/bar/index.php
I want to setup url rewriting so that any request to
http:/
On Thu, Nov 12, 2015 at 11:04:50PM +, Mik J wrote:
Hi there,
> I tried again your solution from yesterday and didn't manage to make it work
If you have one solution that works well enough for you, use it. It is
usually not worth spending more time preparing something than will be
saved by us
Hello Francis,
I tried again your solution from yesterday and didn't manage to make it work
location = /information { rewrite ^ /index.php?x=information; }
location = /index.php {
fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME
$document_root$uri;
fastcgi_param QUERY_STRIN
On Wed, Nov 11, 2015 at 06:50:54PM +, Mik J wrote:
Hi there,
> I tried both methods but none of them worked. I'm going to look at it more in
> details (and display the php logs because I just had a blank page).
First configure things so that an explicit request for
/index.php?x=information
Hello Francis,
First thank you for your answers
I tried both methods but none of them worked. I'm going to look at it more in
details (and display the php logs because I just had a blank page).
Also I would like to know why the solution you're offering is a "best practice"
?At first it seems a b
On Wed, Nov 11, 2015 at 02:29:37PM +, Mik J wrote:
Hi there,
> > I want that a user who accessesnginx.org/informationwill be redirected in
> > the background tonginx/index.php?x=informationSo that my index.php page is
> > dymanic
>
> What does "redirected in the background" mean?M => I jus
Hi there,
> I have checked many ways to implement what I want (including if is evil) and
> I've been able to reach what I wanted to do (something simple)
> I want that a user who accessesnginx.org/informationwill be redirected in the
> background tonginx/index.php?x=informationSo that my index.p
On Wed, Nov 11, 2015 at 01:14:31PM +, Mik J wrote:
Hi there,
> I have checked many ways to implement what I want (including if is evil) and
> I've been able to reach what I wanted to do (something simple)
> I want that a user who accessesnginx.org/informationwill be redirected in the
> back
Hello,
I have checked many ways to implement what I want (including if is evil) and
I've been able to reach what I wanted to do (something simple)
I want that a user who accessesnginx.org/informationwill be redirected in the
background tonginx/index.php?x=informationSo that my index.php page is d
at 11:31 AM, B.R. wrote:
> > Hello,
> >
> > Trying to rewrite an URI based on an argument, I cannot match it
> otherwise
> > than by using rewrite.
> >
> > The problem is I fail to achieve a working recipe rewriting
> > example.com/watch?v=123456
> >
On Sat, Nov 8, 2014 at 11:31 AM, B.R. wrote:
> Hello,
>
> Trying to rewrite an URI based on an argument, I cannot match it otherwise
> than by using rewrite.
>
> The problem is I fail to achieve a working recipe rewriting
> example.com/watch?v=123456
> to
> e
Hello,
Trying to rewrite an URI based on an argument, I cannot match it otherwise
than by using rewrite.
The problem is I fail to achieve a working recipe rewriting
example.com/watch?v=123456
to
example.com/watch?vid=123456
rewrite ^/watch\?v=(?\d+)$ $scheme://$host$uri?vid=$video?
does not
On Fri, Sep 26, 2014 at 10:12:47AM +0530, thunder hill wrote:
> On Fri, Sep 26, 2014 at 2:35 AM, Francis Daly wrote:
> > On Fri, Sep 26, 2014 at 01:20:18AM +0530, thunder hill wrote:
Hi there,
> > > When I access mysite.com/app1 the upstream server rewrites the url like
> > > mysite.com/login in
Hi,
On Fri, Sep 26, 2014 at 2:35 AM, Francis Daly wrote:
> On Fri, Sep 26, 2014 at 01:20:18AM +0530, thunder hill wrote:
>
> Hi there,
>
> > When I access mysite.com/app1 the upstream server rewrites the url like
> > mysite.com/login instead of mysite.com/app1/login and the result is a
> > blan
On Fri, Sep 26, 2014 at 01:20:18AM +0530, thunder hill wrote:
Hi there,
> When I access mysite.com/app1 the upstream server rewrites the url like
> mysite.com/login instead of mysite.com/app1/login and the result is a
> blank page.
>
> Users are allowed either mysite.com/app1 or mysite.com/app2
Hi,
I have two back end application servers behind nginx. The configuration is
as follows
upstream backend1 {
server 10.1.1.11;
}
upstream backend2 {
server 10.2.2.2;
}
server {
listen 80;
server_name mysite.com;
location /appl1 {
#proxy_set_header X-Real
On 1 Apr 2014 19:23, "skyice" wrote:
>
> Hello,
>
> With this rule :
>
> rewrite ^/([^/])(/.*) $2?locale=$1&$query_string last;
Your first capture is looking for exactly 1 character. Do you really mean
that?
J
___
nginx mailing list
nginx@nginx.org
htt
On Tue, Apr 01, 2014 at 02:23:27PM -0400, skyice wrote:
Hi there,
> With this rule :
>
> rewrite ^/([^/])(/.*) $2?locale=$1&$query_string last;
>
> I get a 404 error when I try go on http://example.org/en/test.php instead of
> http://example.org/test.php?locale=en
Does this rewrite regex matc
Hello,
With this rule :
rewrite ^/([^/])(/.*) $2?locale=$1&$query_string last;
I get a 404 error when I try go on http://example.org/en/test.php instead of
http://example.org/test.php?locale=en
Anyone have any idea to solve the problem ?
Thanks.
Posted at Nginx Forum:
http://forum.nginx.org
It seems your syntax is obsolete. Have a look at
http://nginx.org/en/docs/http/converting_rewrite_rules.html where it is
explicitly written.
It is also explicitely wriiten on the wiki page you visited that the
resource is obsolete and that you should use
http://nginx.org/en/docs/http/ngx_http_rewri
Hello
Is there a way to make nginx rewrite the GET request parameters while
configured as a reverse proxy. e.g. if nginx receives a request GET /
foo.html?abc=123 , can nginx rewrite it to GET /foo.html?abc=456 (nginx admin
specifies 123 to be changed to 456) and then do a proxy pass to the orig
On Wed, Dec 04, 2013 at 07:42:17PM -0500, omidr wrote:
Hi there,
> As an example I want to redirect "/آرایشگر" to "/استخدام آرایشگر" and I am
> using a rewrite rulr like the one below but things go wrong and I get a
> 404.
Can I suggest you try to simplify the test case, so that you can see
what
As an example I want to redirect "/آرایشگر" to "/استخدام آرایشگر" and I am
using a rewrite rulr like the one below but things go wrong and I get a
404.
rewrite_rule: rewrite ^/آرایشگر/$ /استخدام آرایشگر;
And what do you mean by config? Do you mean nginx settings or configurations
at compile time?
On Wed, Dec 04, 2013 at 08:22:42AM -0500, omidr wrote:
Hi there,
> But when it comes to urls containing non-English characters the rule doesn`t
> work. Has anyone experienced the same issue?
It seems to work for me.
What config do you use, what request do you make, what response do you get?
I want to rewrite some old urls on my site to new ones inorder to prevent
404 errors. For English urls everything is OK and adding a rewrite rule like
the following to the server block works fine.
rewrite ^/omid/$ /omidreza;
But when it comes to urls containing non-English characters the rule doe
On 08/11/2013 22:43, "Francis Daly" wrote:
>The arguments to try_files are prefixed with the current $document_root
>before being sought as files (with the final argument being magic).
>
>So if you put your to-be-served file in the correct place, and use the
>variables correctly, then it should J
On Fri, Nov 08, 2013 at 05:51:36AM -0600, David Legg wrote:
> I've been trying various things out through try_files which I think is the
> right area to be looking at. Something like:
>
> try_files /tiles/$args_z_$args_x_$args_y.png proxy_hand_off
>
> Any ideas how I could do this?
The argumen
Hi All,
We're starting to make more and more heavy use of Nginx having shifted from
Apache, mostly in handing off to backends running Puma and php-fpm. However,
wherever possible we naturally want Nginx to serve what it can with only the
bare minimum hitting the back end. However, this generall
Duplicate your entire "location / {}" as "location = / {}" (which
matches *only* "/"), and when you detect google, serve
/snapshots/whatever/index.html.
Jonathan
___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Not sure what you mean Jonathan, I can already detect the Google bot by
using ?_escaped_fragment= which is also Google's preferred way over user
agent sniffing. I just need to adapt the rewrite rule to serve index.html to
requests for /.
Thanks for the reply, though!
Posted at Nginx Forum:
http:
I'm sure others will give you better methods to sort this but, as a
temporary fix, how about a separate stanza like this:
location = / {
#special index.html UA-sniffing + rewrite logic
}
Cheers,
Jonathan
___
nginx mailing list
nginx@nginx.org
http://
I have a very Javascript heavy website which is being served by nginx. It
all works great, except Google is having trouble indexing me. I've made
pre-rendered snapshots of all my pages using Phantomjs and these are stored
in /snapshots (relative to my website's root).
I've been using this rewrite
On Mon, May 27, 2013 at 11:31:37AM -0300, Sergio Belkin wrote:
Hi there,
> I'd want that when you type http://example.com/upvc proxies the
> /var/lib/tomcat6/webapps/demo/
> demo3.jsp file to tomcat
Just for clarity, "proxy_pass" proxies to a url, not to a file. So you
probably want it to proxy
2013/5/27 Sergio Belkin
>
> 2013/5/25 Francis Daly
>
>> On Fri, May 24, 2013 at 02:39:58PM -0300, Sergio Belkin wrote:
>>
>> Hi there,
>>
>> > I am completeley newbie to nginx
>>
>> Welcome.
>>
>> The nginx config follows its own logic, which may not match your previous
>> experiences. When you
2013/5/25 Francis Daly
> On Fri, May 24, 2013 at 02:39:58PM -0300, Sergio Belkin wrote:
>
> Hi there,
>
> > I am completeley newbie to nginx
>
> Welcome.
>
> The nginx config follows its own logic, which may not match your previous
> experiences. When you understand that, you'll have a much bette
turn http 503 with the content corresponding to /unav/index.html
> > else
> > give full normal access to the site
>
> My logic is: for all requests (from not an admin) like http://example.org/
> use rewriting and show for clients simple temp html page.
I think that that sta
1\.[0-9]{0,3}') {
rewrite ^/(.*)$ /unav/$1 break;
}
location / {
}
But in log
2013/05/24 08:49:45 [error] 76017#0: *1910 open() "/usr/local/www/akbmaster/unav/unav/index.html"
failed (2: No such file or directory), client: 190.212.201.198, server: akbmaster.server.com, re
al/www/akbmaster/unav/unav/index.html" failed (2: No such file or
> directory), client: 190.212.201.198, server: akbmaster.server.com, request:
> "GET / HTTP/1.1", host: "akbmaster.server.com"
>
> I see twice rewriting.
The initial request was for "/". The
On Fri, May 24, 2013 at 02:39:58PM -0300, Sergio Belkin wrote:
Hi there,
> I am completeley newbie to nginx
Welcome.
The nginx config follows its own logic, which may not match your previous
experiences. When you understand that, you'll have a much better chance
of knowing the configuration you
Let's start by a huge RTFM?
http://nginx.org/en/docs/
This ML is no customer service for lazy people, I guess.
You may up for services to make other people do your job:
http://nginx.com/services.html
Best regards,
---
*B. R.*
On Fri, May 24, 2013 at 1:39 PM, Sergio Belkin wrote:
> H folks!
>
H folks!
I am completeley newbie to nginx
I have the following config
# Forward request to /demo to tomcat. This is for
# the BigBlueButton api demos.
location /demo {
rewrite ^ /upvc;
proxy_pass http://127.0.0.1:8080;
proxy_redir
g
>
> 2013/05/24 08:49:45 [error] 76017#0: *1910 open()
> "/usr/local/www/akbmaster/unav/unav/index.html" failed (2: No such file or
> directory), client: 190.212.201.198, server: akbmaster.server.com,
> request: "GET / HTTP/1.1", host: "akbmaster.server.co
(2: No such file or
directory), client: 190.212.201.198, server: akbmaster.server.com, request:
"GET / HTTP/1.1", host: "akbmaster.server.com"
I see twice rewriting.
I have rewritten rule like this and this solved twice rewriting problem.
rewrite ^/([^/]*)$ /unav/$1 break;
t {
rewrite ^/(.+)$ /index.php?_route_=$1 last;
}
[...skipped...]
location ~ \.php$ {
try_files $uri =404;
fastcgi_read_timeout 60s;
fastcgi_send_timeout 60s;
include myphp-fpm.conf;
}
Problem is in rewriting.
This rule
files $uri =404;
fastcgi_read_timeout 60s;
fastcgi_send_timeout 60s;
include myphp-fpm.conf;
}
Problem is in rewriting.
This rule
rewrite ^/(.*)$ /unav/$1 break;
rewrite ONLY http://mysite.com/ request but in case http://mysite.com/i
If I understand correctly, nginx doesn't do multiple conditions in an 'if'
or nested if's.
Based on some of the ideas being tossed around in this thread
(http://www.webmasterworld.com/google/4537063-11-30.htm) I'd like to
rewrite serve up a one pixel gif to whenever both of the two following
condi
79 matches
Mail list logo