server {
server_name seekadventure.net;
return 301 http://www.seekadventure.net$request_uri;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/seekadventure.net/fullchain.pem; # manag$
ssl_certificate_key /etc/letsencrypt/live/seekadventure.net/privkey.pem; # man$
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
# Security headers
add_header Strict-Transport-Security "max-age=2592000; includeSubDomains; preloa$
location ~* ^/(composer\.(json|lock)|config\.php|flarum|storage|vendor) {
deny all;
return 404;
}
}
server {
# Security headers
add_header Strict-Transport-Security "max-age=2592000; includeSubDomains; preloa$
root /var/www/seekadventure.net;
index index.php index.html index.htm;
error_log /var/log/nginx/error.log error;
server_name www.seekadventure.net;
location / { try_files $uri $uri/ /index.php?$query_string; }
location /api { try_files $uri $uri/ /api.php?$query_string; }
location /admin { try_files $uri $uri/ /admin.php?$query_string; }
location /flarum {
deny all;
return 404;
}
location ~ .php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* \.html$ {
expires -1;
}
location ~* \.(css|js|gif|jpe?g|png)$ {
expires 1M;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
location ~* ^/(composer\.(json|lock)|config\.php|flarum|storage|vendor) {
deny all;
return 404;
}
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types application/atom+xml
application/javascript
application/json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
text/plain
text/xml;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/seekadventure.net/fullchain.pem; # manag$
ssl_certificate_key /etc/letsencrypt/live/seekadventure.net/privkey.pem; # man$
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = seekadventure.net) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name seekadventure.net;
return 404; # managed by Certbot
}
server {
if ($host = www.seekadventure.net) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name www.seekadventure.net;
return 404; # managed by Certbot
}