NGINX – HTTPS & HTTP (When Needed)

After HTTPS was turned on to deal with one issue it, of course, kicked off another unforeseen one. All of the screencast.com content failed to laod. You can see that happening above. It’s never a bad idea to take a look at the console using Chrome’s developer tools when weird stuff happens to a site. Since I couldn’t change anything on the screencast.com side of things, I needed to be able to load this particular site as HTTP rather than HTTPS. I tried a variety of paths based on various Stack Overflow suggestions. I’m not entirely sure I didn’t fix it in various other ways but this one seems to work. I will note that NGINX is a bit like regit and htaccess in that as I get deeper and deeper I begin to suspect it is actually witchcraft. So, to give full directions. I’m SSH’ing into the server via Terminal. I’m navigating to where my NGINX file lives. I’m opening the file in Nano. The 443 server block was already in place. I added the location element within that block. It waits for requests on 443 and should stop the http://rampages.us/psy323 site from being pushed up to https. I also added a second server block listening at the regular port 80 that does nothing with the psy323 address. Next […]

17

NGINX Redirect Tutorial

We recently assigned a few custom domains to rampages. That ended up causing two complications. The first was that some people were using https associated URLs previously (news to me). The always impressive Tim Owens (reclaim hosting support cannot be complimented enough) took care of that for me. @twoodwar Merry Christmas 🙂 #vcualtlab pic.twitter.com/fpT7AQjt2I — Tim Owens (@timmmmyboy) June 16, 2016 The second was the need to redirect some file level1 URLs to some new subdomains. I plain English, I needed https://uc.vcu.edu/focused-inquiry/ to go to http://focusedinquiry.vcu.edu. In any case, Tim gave me some tips and I sallied forth to do the redirects.2 This was my first time doing anything in NGINX so it was a learning experience. I document the steps here in the hope that it’ll be useful to someone else. Keep in mind I’ve only done this on my server so I’m assuming it’s fairly broadly applicable but I can’t be sure of that. I also attempted to either explain or link to things that might be helpful to beginners (like myself). Enter Terminal Land Launch Terminal. I’m using iTerm thanks to Mark Luetke. I’m using a pem file to authenticate which is nice. Read more about pem authentication here. Do keep in mind you need your pem file permissions to be -rw—— (400 I think) even on […]