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
This commit is contained in:
Victor Westerlund 2020-11-28 18:37:48 +01:00
parent ed5bda63b0
commit 919f0fa13b
2 changed files with 43 additions and 2 deletions

1
.gitignore vendored
View file

@ -0,0 +1 @@
.well-known/

View file

@ -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;
}
}