server {
listen 80;
server_name www.hzbiz.bet;
index index.html index.php index.htm;
access_log /usr/local/nginx/logs/8080-access.log main;
error_log /usr/local/nginx/logs/8080-error.log;
return 301 https://$server_name$request_uri;
//这是nginx最新支持的写法,就是这行代码可以实现80端口直接强制跳转到443也就是https
location ~ / {
root /var/www/html/8080;
index index.html index.php index.htm;
}
}