Skip to content
  • Home
  • Photography
    • Photoshoots
  • Blog
  • Search
David Lionheart
David Lionheart
  • Home
  • Photography
    • Photoshoots
  • Blog
Home » Blog » NGINX HTTP to HTTPS Redirect Block
Blog Technology

NGINX HTTP to HTTPS Redirect Block

by David Lionheart|Published October 30, 2019-Updated October 30, 2019

Here is a code block template for a standard NGINX redirect to SSL. This is a wildcard redirect so it will preserve the original URI.

server {
    listen 80;
    server_name Domain.com www.Domain.com;
 
    return 301 https://Domain.com$request_uri;
}
  • NGINX
  • Redirects
  • SSL

AUTHOR

David Lionheart
Photographer, Soccer Player, Wordpress Wizard, Gym Rat & Gamer.
44 posts

You may also like

Published October 1, 2019

How-to Redirect a Website to SSL in cPanel

Login to your cPanel account. https://servername.com:2083 Either type in the search bar, or locate the ‘redirects’ module Click on ‘Redirects’ Leave the […]

Published September 27, 2019

Find all Files Containing a String Including Subdirectories

As a WordPress developer you may often find yourself at the mercy of whichever theme you are using to build a site. […]

Recent Posts

  • How to Preload Customizr Assets for Performance
  • Halo Reach is Back! But is it Still Relevant?
  • How-to Center Contact Form 7
  • Update All MySQL URLs (WordPress FQDN Change)
  • Basic Manifest File Layout

Categories

Blog Body Gaming Holidays Media Mind Music Photography soccer Technology Travel

© 2023 David Lionheart – All rights reserved