fix models

This commit is contained in:
Tykayn 2023-06-12 23:33:07 +02:00 committed by tykayn
parent aed86dd36a
commit 52a3afb98a
3 changed files with 25 additions and 23 deletions

View File

@ -10,6 +10,7 @@ import { makeHostFileForSymfony } from './model.symfony.mjs'
const LXCcontainerLocalIP = '10.10.10.103'
const LXCcontainerProtocol = 'https'
const domainsConfig = [{
LXCcontainerLocalIP,
LXCcontainerProtocol,
@ -129,8 +130,8 @@ for (let configDomain of domainsConfig) {
if (configDomain.framework === 'symfony') {
hostFile = makeHostFileForSymfony(configDomain)
}
writeFile(configDomain.domain + '.host.conf', hostFile.homeNginxConf)
writeFile(configDomain.domain + '.container.conf', hostFile.containerNginxConf)
writeFile(configDomain.domain + '_host.conf', hostFile.homeNginxConf)
writeFile(configDomain.domain + '_container.conf', hostFile.containerNginxConf)
}
function writeFile (fileName, fileContent) {

View File

@ -35,23 +35,23 @@ server {
}
`,
containerNginxConf : `server {
if ($host = ${domainConfig.name}) {
if ($host = ${domainConfig.domain}) {
return 301 https://$host$request_uri;
}
listen 80 ;
listen [::]:80 ;
server_name ${domainConfig.name};
server_name ${domainConfig.domain};
# enforce https
return 301 https://$server_name$request_uri;
add_header Permissions-Policy "interest-cohort=()";
root /home/www/tykayn/${domainConfig.name}/;
root /home/www/tykayn/${domainConfig.domain}/;
index index.php index.html;
}
# ========================== ${domainConfig.name} | fin ================ #
`
}
return model;

View File

@ -22,18 +22,18 @@ export function makeHostFileForWordpress (domainConfig) {
server {
# redirect to https from http
server_name ${domainConfig.name};
server_name ${domainConfig.domain};
listen 80 http2;
return 301 https://${domainConfig.name}$request_uri;
return 301 https://${domainConfig.domain}$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ${domainConfig.name};
ssl_certificate /etc/letsencrypt/live/${domainConfig.name}-0001/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/${domainConfig.name}-0001/privkey.pem;
server_name ${domainConfig.domain};
ssl_certificate /etc/letsencrypt/live/${domainConfig.domain}-0001/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/${domainConfig.domain}-0001/privkey.pem;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
location / {
proxy_set_header X-Forwarded-For $remote_addr;
@ -48,14 +48,14 @@ server {
containerNginxConf: `
# ============ ${domainConfig.name} | côté conteneur LXC ===============
server {
if ($host = www.cipherbliss.com) {
if ($host = ${domainConfig.domain}) {
return 301 https://$host$request_uri;
} # managed by Certbot
}
listen 80 ;
listen [::]:80 ;
server_name www.cipherbliss.com;
server_name ${domainConfig.domain};
# enforce https
return 301 https://$server_name$request_uri;
@ -63,18 +63,20 @@ server {
}
# ==== https | côté conteneur LXC ===============
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.cipherbliss.com;
server_name ${domainConfig.domain};
ssl_certificate /etc/letsencrypt/live/www.cipherbliss.com-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.cipherbliss.com-0001/privkey.pem; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/${domainConfig.domain}-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/${domainConfig.domain}-0001/privkey.pem; # managed by Certbot
# Path to the root of your installation
root /home/www/tykayn/cipherbliss/;
root /home/www/tykayn/${domainConfig.domain}/;
## This should be in your http block and if it is, it's not needed here.
index index.php;
location = /favicon.ico {
@ -106,8 +108,7 @@ server {
}
add_header Permissions-Policy "interest-cohort=()";
}
# ========================== ${domainConfig.name} | fin ================ #
`
}
return model