Initial Commit

This commit is contained in:
2024-09-14 17:13:47 -05:00
parent 8a66d4b350
commit 986404d5b3
14 changed files with 288 additions and 3 deletions

View File

@@ -0,0 +1,49 @@
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
server_name _;
http2 on;
set $base /var/www/html;
root $base/public;
# SSL
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/key.pem;
# security
include nginxconfig.io/security.conf;
# logging
access_log /var/log/nginx/access.log combined buffer=512k flush=1m;
error_log /var/log/nginx/error.log warn;
# index.php
index index.php;
# index.html fallback
location / {
try_files $uri $uri/ /index.html;
}
# index.php fallback
location ~ ^/api/ {
try_files $uri $uri/ /index.php?$query_string;
}
# additional config
include nginxconfig.io/general.conf;
# handle .php
location ~ \.php$ {
fastcgi_pass phpfpm:9000;
include nginxconfig.io/php_fastcgi.conf;
}
}
# HTTP redirect
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host:8443$request_uri;
}