mirror of
https://github.com/BeamMP/BeamMP-Website.git
synced 2026-04-02 22:06:08 +00:00
server hardening + deperation to tget the installer served
This commit is contained in:
23
nginx.conf
23
nginx.conf
@@ -2,11 +2,30 @@ server {
|
||||
listen 80;
|
||||
|
||||
server_name _;
|
||||
server_tokens off;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
index index.html;
|
||||
|
||||
# Baseline security hardening for a static SPA.
|
||||
add_header X-Frame-Options "DENY" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
|
||||
add_header Content-Security-Policy "default-src 'self'; img-src 'self' data: https:; script-src 'self'; style-src 'self' 'unsafe-inline'; font-src 'self' data:; connect-src 'self' https://backend.beammp.com; object-src 'none'; base-uri 'self'; frame-ancestors 'none'" always;
|
||||
|
||||
location = /installer/BeamMP_Installer.msi {
|
||||
default_type application/octet-stream;
|
||||
add_header Content-Disposition 'attachment; filename="BeamMP_Installer.msi"' always;
|
||||
add_header Cache-Control "public, max-age=3600" always;
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location ^~ /installer/ {
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location / {
|
||||
# SPA fallback: serve index.html for non-file routes so Vue Router can render NotFound
|
||||
try_files $uri $uri/ /index.html;
|
||||
@@ -14,8 +33,8 @@ server {
|
||||
|
||||
location ~* \.msi$ {
|
||||
default_type application/octet-stream;
|
||||
add_header Content-Disposition 'attachment';
|
||||
add_header X-Content-Type-Options nosniff;
|
||||
add_header Content-Disposition 'attachment' always;
|
||||
add_header X-Content-Type-Options nosniff always;
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,13 @@ const totalServers = ref('...')
|
||||
const isLoading = ref(true)
|
||||
const heroImageLoaded = ref(false)
|
||||
const heroImageSrc = ref(landingLq)
|
||||
const installerDownloadUrl = `${import.meta.env.BASE_URL}installer/BeamMP_Installer.msi`
|
||||
const installerDownloadUrl = computed(() => {
|
||||
const base = import.meta.env.BASE_URL || '/'
|
||||
if (base === './') {
|
||||
return '/installer/BeamMP_Installer.msi'
|
||||
}
|
||||
return `${base.replace(/\/$/, '')}/installer/BeamMP_Installer.msi`
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user