已解决
发布

How do I configure Nginx to automatically forward HTTP requests to HTTPS for SSL?

1 答案

发布
管理员 2015-06-25

This server block uses the listen directive to accept requests on port 80 and supports IPv6.

server {
  listen [::]:80;
  listen 80;
 
  server_name oneinstack.com www.oneinstack.com;
 
  # and redirect to the https host (declared below)
  # avoiding http://www -> https://www -> https:// chain.
  return 301 https://oneinstack.com$request_uri;
}
#1

请登录或者 注册 来提交答案