Forum: NGINX website with login button, redirect to intranet?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 ericmachine (Guest)
on 2014-06-07 03:08
(Received via mailing list)
Hi everyone,

I would like to check whether this is possible with nginx (on ubuntu
12.04
LTS 64 bits).

I have a website

www.mywebpage.com.my

this is just another website.

There is a login button. When someone click on this login button, it
would
redirect them to https://erp.mywebpage.com.my. However, there are 2
scenarios will happen:-
- if you are connected to our secure VPN (via OpenVPN), this redirection
would be successful.
- if you are not connected to the secure VPN (means the user doesn't
have
any access), then it will show "you are not authorised to view this
page".
This message should appear within www.mywebpage.com.my.

FYI

www.mywebpage.com.my - hosted on a public facing VPS (outside office)

erp.mywebpage.com.my - hosted at my office server (once connected to the
secure VPN, it is as if accessing via intranet)

Is this possible and any suggestions to make this work?

Thanks.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,250715,250715#msg-250715
Ba5061f1803f9ab0cfc3d53366d49546?d=identicon&s=25 Lord Nynex (Guest)
on 2014-06-07 06:53
(Received via mailing list)
Hello,

Assuming your VPN subnet is 10.10.1.0/24, In your server{} block on
erp.mywebpage.com.my you will want to put the following.

allow 10.10.1.0/24;
deny all;

error_page 403 = @403;
location @403 {
  echo "You are not authorized to view this page"
}
2974d09ac2541e892966b762aad84943?d=identicon&s=25 ericmachine (Guest)
on 2014-06-07 16:54
(Received via mailing list)
Thanks :) I will give this a try :)

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,250715,250722#msg-250722
This topic is locked and can not be replied to.