您的位置:首页 > 理论基础 > 计算机网络

nginx配置自动转https站点

2017-10-09 09:17 423 查看
nginx配置自动转https站点,全部内容

server
{
listen 80 ;
#listen [::]:80 default_server ipv6only=on;
server_name www.vueyun.com;
return 301 https://www.vueyun.com$request_uri; 
}
server
{
listen 443;
#listen [::]:80;
server_name www.vueyum.com;
index index.html index.htm index.php default.html default.htm default.php;
root  /home/wwwroot/default/laravellte/public;

ssl on;
ssl_certificate cert/575678678.pem;

ssl_certificate_key cert/6785686578.key;

include enable-php.conf;
#include enable-php-pathinfo.conf;

location /nginx_status
{
stub_status on;
access_log   off;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires      30d;
}

location ~ .*\.(js|css)?$
{
expires      12h;
}

location ~ /.well-known {
allow all;
}

location ~ /\.
{
deny all;
}

location / {
try_files $uri $uri/ /index.php?$query_string;
}
access_log  /home/wwwlogs/access.log;  }

include vhost/*.conf;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: