Quantcast
Channel: linuxadmin: Expanding Linux SysAdmin knowledge
Viewing all articles
Browse latest Browse all 17852

Redirects with nginx

$
0
0

We recently set up an Artifactory server at my company. Right now, the server runs on port 8081, but we're using nginx as a reverse proxy to allow connections over port 80.

We need to take this a step further. If any IP address that is behind our firewall connects to the site, it should use HTTP/port 80 and not force a login (allow anonymous browsing). However, if the IP address is outside the firewall, it should force a redirect to HTTPS/port 443 and force the user to the login page on the site.

To summarize:
Internal (behind firewall) -> HTTP, port 80, no login/anonymous
External (outside firewall) -> HTTPS, port 443, force login (redirect to login page)

Any ideas on how to configure nginx to do this?

submitted by /u/terrymace
[link] [comments]

Viewing all articles
Browse latest Browse all 17852