mirror of
https://github.com/BeamMP/BeamMP-Website.git
synced 2026-10-11 19:14:27 +00:00
Serve .msi as download and update installer link
Add nginx rule to serve .msi files as application/octet-stream with Content-Disposition: attachment and X-Content-Type-Options: nosniff, returning 404 when missing. Update Home.vue to build the installer download URL from import.meta.env.BASE_URL and bind it to the CTA link (using :href) instead of a hardcoded path, ensuring the installer link respects the app base URL.
This commit is contained in:
@@ -12,6 +12,13 @@ server {
|
|||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location ~* \.msi$ {
|
||||||
|
default_type application/octet-stream;
|
||||||
|
add_header Content-Disposition 'attachment';
|
||||||
|
add_header X-Content-Type-Options nosniff;
|
||||||
|
try_files $uri =404;
|
||||||
|
}
|
||||||
|
|
||||||
# Let real 404s for assets return 404s; Vue handles route-level 404 via the SPA fallback above.
|
# Let real 404s for assets return 404s; Vue handles route-level 404 via the SPA fallback above.
|
||||||
|
|
||||||
location /static/ {
|
location /static/ {
|
||||||
|
|||||||
+2
-1
@@ -24,6 +24,7 @@ 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`
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
@@ -193,7 +194,7 @@ const faqs = computed(() => [
|
|||||||
<!-- CTA Buttons -->
|
<!-- CTA Buttons -->
|
||||||
<div class="flex flex-col sm:flex-row gap-4 justify-center items-center pt-4">
|
<div class="flex flex-col sm:flex-row gap-4 justify-center items-center pt-4">
|
||||||
<a
|
<a
|
||||||
href="/installer/BeamMP_Installer.msi"
|
:href="installerDownloadUrl"
|
||||||
download
|
download
|
||||||
class="group flex items-center gap-3 bg-linear-to-r from-beammp-orange to-red-600 hover:from-red-600 hover:to-beammp-orange px-8 py-4 rounded-lg font-semibold text-lg transition-all transform hover:scale-105 shadow-lg hover:shadow-beammp-orange/50 text-white"
|
class="group flex items-center gap-3 bg-linear-to-r from-beammp-orange to-red-600 hover:from-red-600 hover:to-beammp-orange px-8 py-4 rounded-lg font-semibold text-lg transition-all transform hover:scale-105 shadow-lg hover:shadow-beammp-orange/50 text-white"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user