From c5f103a12941cc436fa5ae5b1447ddcbfe54aa86 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Thu, 26 Nov 2020 03:08:13 +0100 Subject: [PATCH 1/4] 0.1.0_dev-11260308 --- .gitignore | 0 api/index.php | 0 public/index.html | 11 +++++++++++ server.conf | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 .gitignore create mode 100644 api/index.php create mode 100644 public/index.html create mode 100644 server.conf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/api/index.php b/api/index.php new file mode 100644 index 0000000..e69de29 diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..9db2d77 --- /dev/null +++ b/public/index.html @@ -0,0 +1,11 @@ + + + + + + Victor Westerlund + + +

Too Early.. but not 425!

+ + \ No newline at end of file diff --git a/server.conf b/server.conf new file mode 100644 index 0000000..ad3e7bf --- /dev/null +++ b/server.conf @@ -0,0 +1,35 @@ +server { + listen 80; + listen [::]:80; + + server_name www.victorwesterlund.com victorwesterlund.com; + + return 301 https://www.victorwesterlund.com$request_uri; +} + +server { + listen 443 ssl; + listen [::]:443 ssl; + + server_name www.victorwesterlund.com; + + ssl on; + include snippets/ssl.conf; + + root /var/www/victorwesterlund.com; + + location \ { + try_files $uri $uri.html $uri/ =404; + } + + location ~ \.php$ { + add_header Access-Control-Allow-Origin *; + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php7.3-fpm.sock; + } + + location ~ /\.git { + deny all; + return 404; + } +} \ No newline at end of file From ed5bda63b0cd8acdf936e40fd8bed46e15e08677 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Sat, 28 Nov 2020 17:30:09 +0100 Subject: [PATCH 2/4] Added new repo to NGINX config Replaced folder root with GitHub-cloned repo --- server.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.conf b/server.conf index ad3e7bf..28fe5f8 100644 --- a/server.conf +++ b/server.conf @@ -16,7 +16,7 @@ server { ssl on; include snippets/ssl.conf; - root /var/www/victorwesterlund.com; + root /var/www/github_victorwesterlund_victorwesterlund.com/public; location \ { try_files $uri $uri.html $uri/ =404; @@ -32,4 +32,4 @@ server { deny all; return 404; } -} \ No newline at end of file +} From 919f0fa13bdf92ce8672307a3dd5b888fb11e009 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Sat, 28 Nov 2020 18:37:48 +0100 Subject: [PATCH 3/4] Added "api" server and HTTP/2 listeners Added servers for "api.victorwesterlund.com" along with an HTTP/2 listener for both 'api' and 'www'. Added ".well-known/" to gitignore --- .gitignore | 1 + server.conf | 44 ++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e69de29..2ca62ca 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +.well-known/ \ No newline at end of file diff --git a/server.conf b/server.conf index 28fe5f8..da8a0c2 100644 --- a/server.conf +++ b/server.conf @@ -1,3 +1,5 @@ +# == victorwesterlund.com == + server { listen 80; listen [::]:80; @@ -8,8 +10,8 @@ server { } server { - listen 443 ssl; - listen [::]:443 ssl; + listen 443 ssl http2; + listen [::]:443 ssl http2; server_name www.victorwesterlund.com; @@ -33,3 +35,41 @@ server { return 404; } } + +# == api.victorwesterlund.com == + +server { + listen 80; + listen [::]:80; + + server_name api.victorwesterlund.com; + + return 301 https://api.victorwesterlund.com$request_uri; +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name api.victorwesterlund.com; + + ssl on; + include snippets/ssl.conf; + + root /var/www/github_victorwesterlund_victorwesterlund.com/api; + + location \ { + try_files $uri $uri.html $uri/ =404; + } + + location ~ \.php$ { + add_header Access-Control-Allow-Origin *; + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php7.3-fpm.sock; + } + + location ~ /\.git { + deny all; + return 404; + } +} \ No newline at end of file From 953b647d253ca106b5030d261885586b76aad52d Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Sun, 29 Nov 2020 01:24:18 +0100 Subject: [PATCH 4/4] Updated canonical name https://www.victorwesterlund.com .. changed to .. https://victorwesterlund.com --- server.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.conf b/server.conf index da8a0c2..b31f8d0 100644 --- a/server.conf +++ b/server.conf @@ -6,14 +6,14 @@ server { server_name www.victorwesterlund.com victorwesterlund.com; - return 301 https://www.victorwesterlund.com$request_uri; + return 301 https://victorwesterlund.com$request_uri; } server { listen 443 ssl http2; listen [::]:443 ssl http2; - server_name www.victorwesterlund.com; + server_name victorwesterlund.com; ssl on; include snippets/ssl.conf;