Simplify cloud-init template - remove templatefile references
This commit is contained in:
parent
c07d280927
commit
dbdda6c9c4
2 changed files with 0 additions and 35 deletions
|
|
@ -40,8 +40,6 @@ server {
|
|||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
include /etc/nginx/snippets/${PROJECT_NAME}-contact-api.conf;
|
||||
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
|
|
@ -63,25 +61,6 @@ server {
|
|||
}
|
||||
EOF
|
||||
|
||||
# Create contact-api nginx snippet
|
||||
cat << 'EOF' > /etc/nginx/snippets/${PROJECT_NAME}-contact-api.conf
|
||||
# Contact API proxy
|
||||
location /api/contact {
|
||||
proxy_pass http://127.0.0.1:3001;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /health {
|
||||
proxy_pass http://127.0.0.1:3001;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
EOF
|
||||
|
||||
# Symlink nginx config
|
||||
ln -sf /etc/nginx/sites-available/${PROJECT_NAME} /etc/nginx/sites-enabled/${PROJECT_NAME}
|
||||
|
||||
|
|
|
|||
|
|
@ -96,23 +96,9 @@ resource "hcloud_server" "krustyplanet" {
|
|||
ip = "10.0.1.10"
|
||||
}
|
||||
|
||||
public_net {
|
||||
enable_ipv4 = true
|
||||
enable_ipv6 = true
|
||||
}
|
||||
|
||||
user_data = templatefile("${path.module}/cloud-init.yaml.tpl", {
|
||||
project_name = var.project_name
|
||||
node_version = var.node_version
|
||||
nginx_config = templatefile("${path.module}/nginx.conf.tpl", {
|
||||
domain = var.domain
|
||||
})
|
||||
contact_api_config = templatefile("${path.module}/contact-api.conf.tpl", {
|
||||
domain = var.domain
|
||||
})
|
||||
contact_api_service = file("${path.module}/contact-api.service.tpl")
|
||||
contact_api_dir = "/opt/contact-api"
|
||||
www_dir = "/var/www/${var.project_name}"
|
||||
})
|
||||
|
||||
labels = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue