From 40e06becdba8ba0378ea9d6ee5bc16126ece6403 Mon Sep 17 00:00:00 2001 From: garhve Date: Fri, 2 Dec 2022 19:35:05 +0800 Subject: transfer blogs 1 --- posts/1/index.html | 50 +++++--------------------------------------------- posts/2/index.html | 2 +- posts/index.html | 2 +- 3 files changed, 7 insertions(+), 47 deletions(-) (limited to 'posts') diff --git a/posts/1/index.html b/posts/1/index.html index 7c4387c..d8f4fef 100644 --- a/posts/1/index.html +++ b/posts/1/index.html @@ -49,7 +49,7 @@ Due to personal interest, I didn’t choose frame to base my website. I - + @@ -125,53 +125,15 @@ Due to personal interest, I didn’t choose frame to base my website. I

Due to personal interest, I didn’t choose frame to base my website. I use Nginx but I don’t familiar with it. making it shows my content is not that difficult even that I don’t know much fancy state, but I stucked on SSL.

In order to use https instead of http, I choosed let’s encrypt, which is good for me and it’s free. However, I can only getting my non-www domain working. when it comes to www domain, it still http.

I found solutions all about using return to returning https, but it won’t work

-
- -
-
1
-2
-3
-4
-
-
server {
+
server {
     server_name www.garhve.com;
 	return 301 https://www.garhve.com$request_uri
 }
-
-
-

This would return me a 404 error…

+

This would return me a 404 error…

After searching and searching, I found where i was getting wrong.

Above statement only return https-www which doesn’t hold any contents, all I need is to redirect the https-www to https-non-www.

So, change to this one

-
- -
-
 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-
-
server {
+
server {
     listen 80;
 	server_name www.garhve.com garhve.com;
 	return 301 https://garhve.com$request_uri;
@@ -195,9 +157,7 @@ Due to personal interest, I didn’t choose frame to base my website. I
   
     #location to real content
 }	# this block is where we hold web content.
-
-
-

It will redirect https-www to https-non-www. Now, both domain will point to same location – my home page.

+

It will redirect https-www to https-non-www. Now, both domain will point to same location – my home page.

diff --git a/posts/2/index.html b/posts/2/index.html index ae8c8af..c389bf2 100644 --- a/posts/2/index.html +++ b/posts/2/index.html @@ -49,7 +49,7 @@ abroad provider because they don’t have to register.. the the budget&a - + diff --git a/posts/index.html b/posts/index.html index e52f93d..947c3f4 100644 --- a/posts/index.html +++ b/posts/index.html @@ -45,7 +45,7 @@ - + -- cgit v1.2.3-70-g09d2