Welcome! Log In Create A New Profile

Advanced

RE: Permanent Redirect on nginx

Mumanyi, Bravismore
April 29, 2016 03:34AM
Francis, your config did magic! Kudos...

However, I just wondering the cause for the redirect URL having two trailing slashes "//" i.e. "http://archives.unam.edu.na//"? The links seem to work though.

The two server blocks are as follows.


server {
listen 80;
listen 443 ssl;
server_name archives.unam.na;
return 301 $scheme://archives.unam.edu.na$request_uri;
}

server {

listen 80;
listen 443 ssl;
root /usr/share/nginx/atom;

# http://wiki.nginx.org/HttpCoreModule#server_name
# _ means catch any, but it's better if you replace this with your server
# name, e.g. archives.foobar.com
#server_name _;
server_name archives.unam.edu.na;

Regards

-----Original Message-----
From: nginx [mailto:nginx-bounces@nginx.org] On Behalf Of Francis Daly
Sent: 28 April 2016 18:15
To: nginx@nginx.org
Subject: Re: Permanent Redirect on nginx

On Thu, Apr 28, 2016 at 02:47:03PM +0000, Mumanyi, Bravismore wrote:

Hi there,

> My org has changed domain from unam.na to unam.edu.na. I intend to effect a permanent redirect on Nginx.

Have two server{} blocks.

The one with "server_name new-name;" should be the fuller one, doing everything you want.

The other should have "server_name old-name;" and "return 301 http://new-name$request_uri;" and not a lot more.

f
--
Francis Daly francis@daoine.org

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

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

Permanent Redirect on nginx

Mumanyi, Bravismore April 28, 2016 10:48AM

Re: Permanent Redirect on nginx

Francis Daly April 28, 2016 01:16PM

RE: Permanent Redirect on nginx

Mumanyi, Bravismore April 29, 2016 03:34AM

Re: Permanent Redirect on nginx

Francis Daly April 30, 2016 03:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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