2653885 发表于 2018-11-15 12:44:42

Nginx自动跳转https-sqtce

  Nginx自动从http跳转到https
  #vim nginx.conf
  server {
  listen 80;
  server_name www.test.com;
  charset utf-8;
  return   301 https://$server_name$request_uri;#添加这行,即可以实现从http跳转到https
  access_loglogs/wwwuat.yaok.com.logmain;
  location / {
  rewrite ^/(.*)$ //$1 last;
  }
  location ^~ // {
  proxy_pass   http://127.0.0.1:8064;
  proxy_redirect off;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
  }

页: [1]
查看完整版本: Nginx自动跳转https-sqtce