Sample Header Ad - 728x90

website STILL need to redirect from HTTP to https after Nginx redirect config

0 votes
0 answers
72 views
I use AWS EC2 to build a website using load balancer. However, the pentesting result shows that the website still could be reached by http. I have checked that in the Nginx config file, we does have a http to https redirect. server { listen 80 default_server; listen [::]:80 default_server; server_name _; root /usr/share/nginx/html; return 301 https://$server_name$request_uri ; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; # disable checking file size for upload client_max_body_size 0; location / { proxy_pass http://127.0.0.1:8000/ ; proxy_set_header HOST \$host; proxy_set_header X-Forwarded-Proto \$scheme; proxy_set_header X-Real-IP \$remote_addr; proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; } location /flower/ { # rewrite ^/flower/(.*)$ /\$1 break; proxy_pass http://127.0.0.1:5555/ ; proxy_set_header HOST \$host; proxy_set_header X-Forwarded-Proto \$scheme; proxy_set_header X-Real-IP \$remote_addr; proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } # Settings for a TLS enabled server. server { listen 443 ssl http2 default_server; listen [::]:443 ssl http2 default_server; server_name _; root /usr/share/nginx/html; Why the website still allow the communication of HTTP?
Asked by Django (1 rep)
Jan 8, 2021, 02:47 AM
Last activity: Jan 8, 2021, 06:11 AM