Y
Y
Yuri2016-03-13 11:12:12
Nginx
Yuri, 2016-03-13 11:12:12

How to disable nginx redirect from http to https?

Here are the /etc/nginx/nginx.conf configs:

http {
    log_format ispmgrnode '$server_name $request_length $bytes_sent';
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    client_max_body_size 100M;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
  include /etc/nginx/vhosts/*/*;
  server {
    server_name localhost;
  disable_symlinks if_not_owner;
  include /etc/nginx/vhosts-includes/*.conf;
  client_max_body_size 100M;
  location @fallback {
    error_log /dev/null crit;
    proxy_pass http://127.0.0.1:8080;
    proxy_redirect http://127.0.0.1:8080 /;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
  listen 80;
  listen *.*.*.*:80 default_server;
  }
  server {
    server_name localhost;
  disable_symlinks if_not_owner;
  include /etc/nginx/vhosts-includes/*.conf;
  location @fallback {
    error_log /dev/null crit;
    proxy_pass http://127.0.0.1:8080;
    proxy_redirect http://127.0.0.1:8080 /;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
  add_header Strict-Transport-Security "max-age=31536000;";
  listen *.*.*.*:443 default_server;
  ssl on;
  ssl_certificate "/usr/local/mgr5/etc/nginx_certs/default_srv.crtca";
  ssl_certificate_key "/usr/local/mgr5/etc/nginx_certs/default_srv.key";
  ssl_ciphers HIGH:!RC4:!aNULL:!eNULL:!MD5:!EXPORT:!EXP:!LOW:!SEED:!CAMELLIA:!IDEA:!PSK:!SRP:!SSLv2;
  ssl_prefer_server_ciphers on;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  }
}

What needs to be changed / added so that the site opens in both http and https?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2016-03-13
@Seconds

You have a strict security transparency that tells the browser if the site has been opened at least once with ssl open it always with ssl

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question