Redirects www to andreaslop.nl and closes out the front-end shell
IIS now sends www.andreaslop.nl to https://andreaslop.nl in one step, so monitoring and search engines see a single address. The go-live steps check the redirect and wait for the privacy statement, and the readiness checklist lists what is left for the go-live. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { monitoringFor } from '../src/monitoring/config';
|
||||
import { securityHeaders } from './securityHeaders';
|
||||
import {
|
||||
iisWebConfig,
|
||||
nginxProxyConf,
|
||||
nginxTestConf,
|
||||
productionHost,
|
||||
serverConfigFiles,
|
||||
} from './serverConfig';
|
||||
|
||||
@@ -29,6 +31,24 @@ describe('serverconfiguratie', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('IIS stuurt www in één stap door naar https://andreaslop.nl', () => {
|
||||
const iis = iisWebConfig();
|
||||
expect(iis).toContain(
|
||||
'<add input="{HTTP_HOST}" pattern="^www\\.andreaslop\\.nl$" />',
|
||||
);
|
||||
expect(iis).toContain(
|
||||
'<action type="Redirect" url="https://andreaslop.nl/{R:1}" redirectType="Permanent" />',
|
||||
);
|
||||
// Vóór de HTTPS-regel, anders eerst http://www → https://www
|
||||
expect(iis.indexOf('name="www naar')).toBeLessThan(
|
||||
iis.indexOf('name="HTTPS"'),
|
||||
);
|
||||
});
|
||||
|
||||
it('www-doorverwijzing verwijst naar de productiehost uit de monitoring', () => {
|
||||
expect(monitoringFor(productionHost)?.environment).toBe('production');
|
||||
});
|
||||
|
||||
it('IIS heeft een SPA-fallback en een HTTPS-redirect', () => {
|
||||
const iis = iisWebConfig();
|
||||
expect(iis).toContain('<action type="Rewrite" url="/index.html" />');
|
||||
|
||||
@@ -15,7 +15,13 @@ const xmlAttribute = (value: string) =>
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
|
||||
// IIS (productie): security headers, HTTPS-redirect, SPA-fallback en caching.
|
||||
// De enige productiehost: www stuurt hierheen door, zodat monitoring (alleen
|
||||
// op deze hostname) en zoekmachines één adres zien
|
||||
export const productionHost = 'andreaslop.nl';
|
||||
|
||||
// IIS (productie): www-doorverwijzing, security headers, HTTPS-redirect,
|
||||
// SPA-fallback en caching. De www-regel staat vóór HTTPS, zodat
|
||||
// http://www. in één stap op https://andreaslop.nl uitkomt.
|
||||
// Bestanden in /assets hebben een hash in de naam en mogen lang gecachet
|
||||
// worden; index.html nooit, zodat een nieuwe release direct zichtbaar is.
|
||||
export function iisWebConfig(): string {
|
||||
@@ -32,6 +38,13 @@ export function iisWebConfig(): string {
|
||||
<system.webServer>
|
||||
<rewrite>
|
||||
<rules>
|
||||
<rule name="www naar ${productionHost}" stopProcessing="true">
|
||||
<match url="(.*)" />
|
||||
<conditions>
|
||||
<add input="{HTTP_HOST}" pattern="^www\\.${productionHost.replace(/\./g, '\\.')}$" />
|
||||
</conditions>
|
||||
<action type="Redirect" url="https://${productionHost}/{R:1}" redirectType="Permanent" />
|
||||
</rule>
|
||||
<rule name="HTTPS" stopProcessing="true">
|
||||
<match url="(.*)" />
|
||||
<conditions>
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
<system.webServer>
|
||||
<rewrite>
|
||||
<rules>
|
||||
<rule name="www naar andreaslop.nl" stopProcessing="true">
|
||||
<match url="(.*)" />
|
||||
<conditions>
|
||||
<add input="{HTTP_HOST}" pattern="^www\.andreaslop\.nl$" />
|
||||
</conditions>
|
||||
<action type="Redirect" url="https://andreaslop.nl/{R:1}" redirectType="Permanent" />
|
||||
</rule>
|
||||
<rule name="HTTPS" stopProcessing="true">
|
||||
<match url="(.*)" />
|
||||
<conditions>
|
||||
|
||||
Reference in New Issue
Block a user