This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($http_origin ~ '^https?://((sub1\.test\.com\)|(sub2\.test\.com))') { | |
set $cors 'true'; | |
} | |
if ($cors = 'true') { | |
add_header 'Access-Control-Allow-Origin' "$http_origin" always; | |
add_header 'Access-Control-Allow-Credentials' 'true' always; | |
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always; | |
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always; | |
# required to be able to read Authorization header in frontend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
DocumentRoot /var/www/html/ | |
ServerName example.com | |
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains" | |
SetEnvIf Origin "http(s)?://(www\.)?(dev.test.co:18088|uat.test.co:18088|test.com)$" AccessControlAllowOrigin=$0 | |
Header always set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin | |
Header always set Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS" | |
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token, token, x-locale" | |
Header always set Access-Control-Expose-Headers "Content-Security-Policy, Location" | |
Header always set Access-Control-Max-Age "600" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For more information on configuration, see: | |
# * Official English Documentation: http://nginx.org/en/docs/ | |
# * Official Russian Documentation: http://nginx.org/ru/docs/ | |
user nginx; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log; | |
pid /run/nginx.pid; | |
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locals { | |
nested_map = { | |
"app1" = { | |
"port" = 80 | |
"image" = "nginx:latest" | |
"url" = [ | |
"https://www.google.com", | |
"https://www.github.com", | |
"https://www.hashicorp.com" | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jakarta.xml.bind.JAXBContext | |
import jakarta.xml.bind.JAXBElement | |
import jakarta.xml.bind.Marshaller | |
import org.slf4j.Logger | |
import org.slf4j.LoggerFactory | |
import java.io.FileOutputStream | |
import javax.xml.namespace.QName | |
import javax.xml.stream.XMLOutputFactory | |
import javax.xml.stream.XMLStreamWriter |