mirror of
https://github.com/BeamMP/BeamMP-Website.git
synced 2026-10-25 21:40:04 +00:00
server hardening + deperation to tget the installer served
This commit is contained in:
1 parent
4626a69185
commit
a253919575
2 files changed
+28
-3
No files matched your search
+21
-2
@@ -2,11 +2,30 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
|
|
||||||
server_name _;
|
server_name _;
|
||||||
|
server_tokens off;
|
||||||
|
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
|
|
||||||
index index.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 / {
|
location / {
|
||||||
# SPA fallback: serve index.html for non-file routes so Vue Router can render NotFound
|
# SPA fallback: serve index.html for non-file routes so Vue Router can render NotFound
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
@@ -14,8 +33,8 @@ server {
|
|||||||
|
|
||||||
location ~* \.msi$ {
|
location ~* \.msi$ {
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
add_header Content-Disposition 'attachment';
|
add_header Content-Disposition 'attachment' always;
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header X-Content-Type-Options nosniff always;
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-1
@@ -24,7 +24,13 @@ const totalServers = ref('...')
|
|||||||
const isLoading = ref(true)
|
const isLoading = ref(true)
|
||||||
const heroImageLoaded = ref(false)
|
const heroImageLoaded = ref(false)
|
||||||
const heroImageSrc = ref(landingLq)
|
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 () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in new issue
Block a user