61 lines
2.0 KiB
Nginx Configuration File
61 lines
2.0 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name aostia.me *.aostia.me;
|
|
|
|
include snippets/letsencrypt.conf;
|
|
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name www.aostia.me;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/aostia.me/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/aostia.me/privkey.pem;
|
|
ssl_trusted_certificate /etc/letsencrypt/live/aostia.me/chain.pem;
|
|
include snippets/ssl.conf;
|
|
include snippets/letsencrypt.conf;
|
|
|
|
return 301 https://aostia.me$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name aostia.me;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/aostia.me/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/aostia.me/privkey.pem;
|
|
ssl_trusted_certificate /etc/letsencrypt/live/aostia.me/chain.pem;
|
|
include snippets/ssl.conf;
|
|
include snippets/letsencrypt.conf;
|
|
|
|
root /var/www/aostia.me/html;
|
|
|
|
index index.php index.html;
|
|
|
|
access_log /var/log/nginx/aostia.me.access.log;
|
|
error_log /var/log/nginx/aostia.me.error.log;
|
|
|
|
add_header X-XSS-Protection "1; mode=block";
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin";
|
|
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';
|
|
add_header Content-Security-Policy "default-src 'self'; img-src 'self'; font-src 'self' ka-f.fontawesome.com fonts.gstatic.com; style-src 'self' 'unsafe-inline' fonts.googleapis.com; script-src 'self' 'unsafe-inline'; connect-src 'self' ka-f.fontawesome.com";
|
|
|
|
location / {
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
location ~ \.php$ {
|
|
include snippets/fastcgi-php.conf;
|
|
fastcgi_pass unix:run/php/php7.4-fpm.sock;
|
|
}
|
|
location /api {
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_pass http://localhost:1109;
|
|
}
|
|
} |