Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

  • Edite o arquivo domain.xml ([diretório_instalação]/appserver/domain/configuration/domain.xml)
  • Procure pela seguinte linha:

...

languagexml
  • <response-

...

  • header header-name="Access-Control-Allow-Origin" header-value="*" name="Access-Control-Allow-Origin"/>
Bloco de código
languagexml
<response-header header-name="Access-Control-Allow-Origin" header-value="*" name="Access-Control-Allow-Origin"/>
  • Substitua o "*" pela URL de acesso ao TOTVS Fluig Plataforma. Por exemplo, se a URL de acesso ao fluig for "https://www.minhaempresa.com.br", ficaria assim:
Bloco de código
languagexml
<response-header header-name="Access-Control-Allow-Origin" name="Access-Control-Allow-Origin" header-value="httpsheader-value="https://www.minhaempresa.com.br" name="Access-Control-Allow-Origin"/>
  • Reinicie os serviços da plataforma

Permitindo a conexão de uma única origem

...

Bloco de código
languagexml
<response-header header-name="Access-Control-Allow-Origin" header-value="*" name="Access-Control-Allow-Origin" header-value="*" />
Bloco de código
languagexml
<response-header header-name="Access-Control-Allow-Origin" name="Access-Control-Allow-Origin" header-value="https:header-value="https://www.outrosite.com.br" name="Access-Control-Allow-Origin"/>
  • Reinicie os serviços da plataforma

Permitindo a conexão de múltiplas origens

...

Bloco de código
languagetext
titlefluig.conf
upstream fluig-http {
    server 192.168.2.100:8080;
}

server {
    listen                    443 ssl;
    server_name               *.minhaempresa.com;
    server_tokens             off;
    ssl_certificate           fullchain.pem;
    ssl_certificate_key       privkey.pem;
	ssl_protocols             TLSv1.2 TLSv1.3;
	ssl_ciphers                        ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK;
	ssl_prefer_server_ciphers on;
	ssl_session_cache         shared:SSL:10m;

    location / {
:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK; # Se necessário complemente com outras chaves Ciphers suportadas;
	ssl_prefer_server_ciphers on;
	ssl_session_cache         shared:SSL:10m;

    location / {
        set $CORS "";
        # Lista de origens permitidas
        if ($http_origin ~* "^https://(www.minhaempresa.com|empresa1.com|api.empresa2.com)$") {
            set $CORS "O";
        }
        if ($request_method = 'OPTIONS') {
            set $CORS "${CORS}O";
        # Lista de origens permitidas}

        if ($http_origin ~* "^https://(www.minhaempresa.com|empresa1.com|api.empresa2.com)$$CORS = "OO") {
            set $CORS "O"add_header Access-Control-Allow-Origin $http_origin;
        }
    add_header Access-Control-Allow-Methods 'GET, POST, if ($request_method = 'OPTIONS') {
            set $CORS "${CORS}O";
 OPTIONS, PUT';
       }

     add_header   if ($CORS = "OO") {Access-Control-Allow-Headers 'Accept,Authorization,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
            add_header Access-Control-Allow-Origin $http_originCredentials 'true';
            add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS, PUTMax-Age 3600;
            add_header Content-Type 'text/plain charset=UTF-8';
            add_header Access-Control-Allow-Headers 'Accept,Authorization,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
Content-Length 0;

            add_header Access-Control-Allow-Credentials 'true'return 204;
        }

         add_header Access-Control-Max-Age 3600;if ($CORS = "O") {
            add_header Content-Type 'text/plain charset=UTF-8'Access-Control-Allow-Origin $http_origin;
            add_header Content-Length 0;

            return 204Access-Control-Allow-Methods 'GET, POST, OPTIONS, PUT';
        }

    add_header    if ($CORS = "O") {Access-Control-Allow-Headers 'Accept,Authorization,Content-Type,X-Requested-With,User-Agent,If-Modified-Since,Cache-Control';
            add_header Access-Control-Allow-Origin $http_originCredentials 'true';
            add_header Access-Control-AllowMax-Methods 'GET, POST, OPTIONS, PUT'Age 3600;
        }

        addproxy_header Access-Control-Allow-Headers 'Accept,Authorization,Content-Type,X-Requested-With,User-Agent,If-Modified-Since,Cache-Control'pass http://fluig-http;
         proxy_ssl_verify   add_header Access-Control-Allow-Credentials 'true';
     off;
        proxy_ssl_ciphers   HIGH:!aNULL:!MD5;

        addproxy_set_header AccessX-ControlForwarded-Max-Age 3600Host $host:443;
        }
proxy_set_header X-Forwarded-Server $host;
        proxy_set_pass http://fluig-httpheader X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_sslset_verifyheader    offX-Forwarded-Proto https;
        proxy_sslset_ciphersheader   HIGH:!aNULL:!MD5;
X-Real-IP $remote_addr;
		
        proxyclient_max_set_header X-Forwarded-Host $host:443;
body_size        proxy_set_header X-Forwarded-Server $host880m;
        proxyclient_set_header X-Forwarded-For $proxy_add_x_forwarded_for;body_buffer_size    256k;

        proxy_set_header X-Forwarded-Proto httpsconnect_timeout      800;
        proxy_setsend_headertimeout X-Real-IP $remote_addr;
		
        client_max_body_size800;
        880m;
proxy_read_timeout        client_body_buffer_size    256k800;

        proxy_connect_timeoutbuffer_size          8008k;
        proxy_send_timeoutbuffers         800;
     8 32k;
  proxy_read_timeout         800;

        proxy_bufferproxy_busy_buffers_size          8k64k;
        proxy_buffers              8 32k;
        proxy_busy_buffers_size    64k;
        proxy_temp_file_write_size 64k;
    }
}_temp_file_write_size 64k;
    }
}
Nota

Recomendamos o uso de chaves mais modernas e seguras como os indicados no exemplo. Porém, outras chaves também são suportadas:

DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA

Preencha a diretiva ssl_ciphers do fluig.conf substituindo pelos valores suportados acima que estejam de acordo com sua política de segurança. As chaves podem ser validadas em https://ciphersuite.info/.

Utilizando Apache para configurar CORS

...