Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Error redirect http to https

$
0
0
[root@balanceadorA1 conf]# cat nginx.conf

worker_processes auto;

events {
worker_connections 1024;
}


http {

upstream cluster1 {
# simples round-robin
server 172.16.1.2:80;
server 172.16.1.7:80 backup;
check interval=3000 rise=2 fall=5 timeout=1000 type=http;
check_http_send "HEAD / HTTP/1.0\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;
}

upstream cluster2 {
server 172.16.1.23:80;
server 172.16.1.24:80;
check interval=3000 rise=2 fall=5 timeout=1000 type=http;
check_http_send "HEAD / HTTP/1.0\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;
}

upstream sage {
server 172.16.1.1:80;
check interval=3000 rise=2 fall=5 timeout=1000 type=http;
check_http_send "HEAD / HTTP/1.0\r\n\r\n";
}


include TCE/teste.com.br;

[root@balanceadorA1 TCE]# cat teste.com.br
server {
listen 80;
server_name teste.com.br;
rewrite ^/(.*)$ https://$server_name$request_uri? permanent;
# return 307 https://$server_name$request_uri;
}

server {
listen 443 ssl;
server_name teste.com.br;

# SSL code
ssl on;
ssl_certificate /usr/include/nginx/conf/TCE/TCEMT.crt;
ssl_certificate_key /usr/include/nginx/conf/TCE/tcemt.key;
ssl_prefer_server_ciphers on;

location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_redirect off;

proxy_pass http://cluster2;
}

client_max_body_size 4G;
keepalive_timeout 10;
}


[root@balanceadorA1 conf]# tail -f ../logs/access.log
10.69.39.9 - - [05/Jul/2017:08:53:23 -0400] "GET /auth/login HTTP/1.1" 200 4482 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
10.69.39.9 - - [05/Jul/2017:08:53:23 -0400] "GET /favicon.ico HTTP/1.1" 200 0 "https://teste.com.br/auth/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
172.16.0.3 - - [05/Jul/2017:08:53:24 -0400] "GET / HTTP/1.1" 200 17425 "-" "curl/7.29.0"
10.69.39.9 - - [05/Jul/2017:08:53:24 -0400] "GET /auth/login HTTP/1.1" 200 4482 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
10.69.39.9 - - [05/Jul/2017:08:53:24 -0400] "GET /favicon.ico HTTP/1.1" 200 0 "https://teste.com.br/auth/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
10.69.39.9 - - [05/Jul/2017:08:53:24 -0400] "GET /auth/login HTTP/1.1" 200 4482 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
10.69.39.9 - - [05/Jul/2017:08:53:24 -0400] "GET /favicon.ico HTTP/1.1" 200 0 "https://teste.com.br/auth/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
10.69.39.9 - - [05/Jul/2017:08:53:24 -0400] "GET /auth/login HTTP/1.1" 200 4482 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
10.69.39.9 - - [05/Jul/2017:08:53:24 -0400] "GET /favicon.ico HTTP/1.1" 200 0 "https://teste.com.br/auth/login" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
172.16.0.3 - - [05/Jul/2017:08:53:26 -0400] "GET / HTTP/1.1" 200 17425 "-" "curl/7.29.0"

version: 59
Ex.js:1068 ex.js page check url
login:9 Mixed Content: The page at 'https://teste.com.br/auth/login' was loaded over HTTPS, but requested an insecure stylesheet 'http://teste.com.br/css/main.css'. This request has been blocked; the content must be served over HTTPS.
Ex.js:1074 0
login:1 Mixed Content: The page at 'https://teste.com.br/auth/login' was loaded over HTTPS, but requested an insecure script 'http://teste.com.br/components/jquery/dist/jquery.min.js'. This request has been blocked; the content must be served over HTTPS.
login:1 Mixed Content: The page at 'https://teste.com.br/auth/login' was loaded over HTTPS, but requested an insecure script 'http://teste.com.br/components/bootstrap-sass-twbs/assets/javascripts/bootstrap.js'. This request has been blocked; the content must be served over HTTPS.
certisignerconf.js:4 A div certisigner-enabled nao foi encontrada.
Ex.js:1085 https://teste.com.br/auth/login
Ex.js:1086 ************* startProtect 2datetime: Wed Jul 05 2017 08:53:37 GMT-0400 (Hora Padrão Brasil Central)
Ex.js:1094 request.firstRun ::2

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>