From be772f40c42711de54a3331db2781b1511acba9d Mon Sep 17 00:00:00 2001 From: garhve Date: Mon, 2 Jan 2023 06:02:01 +0800 Subject: change to zola --- public/post/first-website/index.html | 111 +++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 public/post/first-website/index.html (limited to 'public/post/first-website') diff --git a/public/post/first-website/index.html b/public/post/first-website/index.html new file mode 100644 index 0000000..a76d054 --- /dev/null +++ b/public/post/first-website/index.html @@ -0,0 +1,111 @@ + + + + + + +First Website | garhve's gibberish + + + + + + + + + + + +
+ + +
+ + +
+
+ +

+

First Website
+

+

+

2022-08-10
+
+ + + /period + + + + +  #gibberish + + +
+

+ +

+

So now I can say my website is on.. even though it just literally has nothing but a printing hello +FirstWebsite.png

+

I got this garhve.com domain on namesilo for $9.95 per year, it's really cheap! I always want a domain that is .com suffix.

+

Now, the web is https, this is a bit difficult for me.

+

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

+
server {
+    server_name www.garhve.com;
+	return 301 https://www.garhve.com$request_uri
+}
+
+

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

+
server {
+    listen 80;
+	server_name www.garhve.com garhve.com;
+	return 301 https://garhve.com$request_uri;
+}	# this block will redirect http-both to https-both
+
+server {
+    listen 443 ssl http2;	#http2 is newer and more secure http
+    listen [::]:443 ssl http2;
+  
+    server_name www.garhve.com;
+    include /path_to_cert_file;
+    return 301 https://garhve.com$request_uri;
+}	# this block will redirect https-www to https-non-www
+
+server {
+    listen 443 ssl http2;
+    listen [::]:443 ssl http2;
+  
+    server_name garhve.com;
+    include /path_to_cert_file;
+  
+    #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.

+ +

+ + + + +
+
+ + + + + -- cgit v1.2.3-70-g09d2