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') {OPTIONS, PUT';
set $CORS "${CORS}O";
}
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';
if ($CORS = "OO") {add_header Access-Control-Allow-Credentials 'true';
add_header Access-Control-AllowMax-OriginAge $http_origin3600;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS, PUTContent-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;
}
} |