victorwesterlund.com/server.conf
Victor Westerlund b15983ceae Added status checker endpoint for Shields.io
Added status checker endpoint for Shields.io under "status.php"

Added router.php and reference in server.conf

Removed ping.php
2021-02-08 12:38:13 +01:00

82 lines
1.9 KiB
Text

# == victorwesterlund.com ==
server {
listen 80;
listen [::]:80;
server_name www.victorwesterlund.com victorwesterlund.com;
return 301 https://victorwesterlund.com$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name victorwesterlund.com;
ssl on;
include snippets/ssl.conf;
root /var/www/victorwesterlund.com/public;
error_page 404 403 /netwatch/PAGE_NOT_FOUND.html;
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;
}
}
# == 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/victorwesterlund.com/api/endpoint;
location / {
try_files $uri $uri.html $uri/ @extensionless-php;
index index.html index.htm index.php;
}
location ~ \.php$ {
try_files $uri $uri/ /router.php =404;
add_header Access-Control-Allow-Origin *;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}
location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}
location ~ /\.git {
deny all;
return 404;
}
}